Family Encyclopedia >> Electronics

What you need to know about video encoding

Nowadays, we have the ability to make HD videos on our computer. It's amazing that we can even do that, let alone do it to such high quality. But video encoding has a lot of variables, and sometimes it's hard to know what to choose for high-quality, high-resolution videos that can be played easily on computers.

SummaryClear and crisp videoI don't know what that meansEncoders and appsRecipe for successBonus recipe for YouTube

In this article, we ask what are the ideal settings for making small, fast videos on Macs

Sharp-and-sharp video

When encoding videos on your Mac, you sometimes have choices like codecs, bitrates, frame rates, resolutions, and more. Most of them are self-explanatory, but some are crucial to the quality and file size of your output.

What's the point of making a good video if it's so huge it won't run because it fills the memory of the machine it's playing on or if it's so heavily compressed it looks like it was animated at from LEGO?

I don't know what that means

Codec – It is the software of your video program that encodes the video. Codecs have improved beyond recognition since the first implementation of Quicktime, and one of the best codecs for small size, fast playback, and high quality is H264.

Yes, there are higher quality codecs, but the most widely available in commercial software is probably H264. It is an MPEG-4 or MP4 codec, which makes it compatible with most video playback software and hardware media players that you would plug into your TV.

Frame rates – It depends on your source video. If you are shooting with a camera and loading the footage into an editing system, it will tell you the frame rate in which your camera captured the footage. Cameras in old NTSC territories tend to be 30 frames per second. and PAL countries are 25 fps (FPS is frames per second), so it will either be 30 fps (sometimes expressed as 29.97 fps) or 25 fps. Do not change or mix frame rates as this causes problems.

Keyframes - Of all the soft compressed frames, there are uncompressed or "key" frames to give the compression something to chew on and help make the video look crisp and uncompressed. Go about one per second, i.e. for 25 fps video every 25 frames, for 30 fps video one every 30 frames, etc.

Aspect ratio or resolution – Set “1920 x 1080” for Full HD and “1280 x 720” for normal HD. Standard definition formats are minefields, so avoid them if necessary (we may cover this at some point in the future, so let us know if you need to). The aspect ratio must be the same as the source, they must be 16:9, or 16 units wide by 9 high.

Throughput - It's delicate. Uncompressed and unprocessed full-frame HD video is a huge amount of data and cannot be played smoothly at 25-30 frames per second on a computer. To make it play, you need to compress it. It's like the difference between a TIFF image and JPG or PNG.

Basically, you're removing all the "air" from the file; any unnecessary areas when you could get away with a solid color block rather than a subtle graduated tint save you bits. The trade-off means that file size goes down, but so does quality.

Here is a before photo,

What you need to know about video encoding

1500-3000 is ok for a small decent quality video, but as you see above the quality will be noticeable on any smooth shading area, and forget about detailed film grain, snow or other particles. Go as high as you dare. As a guideline, DVD bit rate is usually around 5000-10000 and Blu-Ray is around 20000-30000.

Interlace - Do not bother. Interlacing is a thing of the past and has no place in this world of non-interlaced progressive video.

Encoders and applications

There are many reasons why you might need to encode a video. Maybe you're running a full-featured video editing suite like Lightworks, and you want to create a video that's compatible with YouTube or just works well from email.

The newer version of Quicktime does a lot of the heavy lifting, but it's a good thing if you can get a copy of the older Quicktime 7 and upgrade to the Pro version. , because it accepts many different things. video formats and exports them with lots of fine control.

A good thing to have is FFMPGX, which is for all types of video, not just MPEG. It's a swiss army knife tool that can take just about any video file you throw at it and turn it into something useful. It has a $15 shareware fee and is worth it if you can afford it, but it still lets you use it for free and isn't too harsh about it.

It is very easy to use; just drop the video you want to recode and select the target format from the drop-down list.

What you need to know about video encoding

Recipe for success

So to recap, choose H264, use the same FPS as your source video, and turn interlacing off. If 1920 x 1080 creates large files or runs slowly on your machine, reduce the size to 1280 x 720. This smaller HD size was good enough for early HD feature films, so it's good enough for you.

Set your bitrate to 1500, then encode and see what you get. If the quality of the video you are encoding is small but horrible, set it to 3000 and try again. It will be larger in size but much smoother. If the quality still isn't good, adjust the bitrate higher until you get the balance of quality and size you're looking for.

Bonus recipe for YouTube

For YouTube you need to do the following (Quicktime 7 is used in this example):

  • Use the H.264 codec. Set Quality to Best and Encoding to Multipass.
  • Set Keyframes and Datarates to Automatic and uncheck "Frame Rearrangement".
  • Set it to 1920 x 1080 or 1280 x 720 for HD video and set the same frame rate as the original video.
  • For audio, set compression to AAC:48KHz, 128kbps, 16-bit constant bit rate (CBR), stereo.
  • Deinterlace, sure, but don't just do it because it's old-fashioned, but because it helps smooth out those bits of fast motion if you do. You don't want those ugly comb-like bangs on everything.
  • And finally, prepare for Internet streaming by setting to "Quick Start".

Do it like this, and you shouldn't get any warnings about your video quality. Okay, they might say they detected your video is choppy, but aside from any tools or add-ons, your video should encode for YouTube flash or HTML5 without issue.

If you have any video encoding tips, let us know in the comments below.

Photo credit:Feign Pressure by Phil Sud