Choosing the Best Video Codec

Posted: May 15, 2011

[ This article was first published in the June, 2006, issue of
Larry's Final Cut Pro Newsletter. Click here to subscribe. Updated February 2009 ]

 

This technique grew out of a comment from Diane Thompson, who wrote:

[Would you] explain the sequence settings in the GENERAL tab? I have been unable to find a description of each of the compressors with info about its pros and cons or best use so that I can make a decision which is best. (By the way, I really really appreciated last month’s video processing tab discussion!)

Larry replies: Diane, email flame-throwing contests have started from much more innocent requests, but, what the heck, things are quiet at the moment. This is not an exhaustive discussion, as there are dozens and dozens of codecs with more sprouting up every day. However, I can help you understand what a codec does and how to choose one that will work for you.

Also, capture card developers, such as Blackmagic Design and AJA, and camera manufacturers, such as Panasonic and Sony, often create their own codecs to take advantage of special technology built into their equipment. This article will not cover those special codecs.

But, even with those restrictions, there’s still lots to talk about. And I’ll start with some background.

All Video is Compressed

All video that we shoot on tape or watch on TV is compressed. This has been true since the beginning of time — or, well, the beginning of video at least.

Some video, like DV or HDV, is significantly compressed in a number of ways. Other video, like DigiBetacam is compressed less.

The reason for all this compression is that video files are HUGE and engineers are always looking for ways to make them smaller without sacrificing too much quality. That’s where codecs (short for: COmpressor/DECompressor) come in. A codec provides specific instructions on how to compress video to reduce it’s size, then decompress it to “full quality” for playback.

There are four principal goals to consider when choosing a codec:

  1. The size of the compressed file
  2. The speed of compression
  3. The speed of decompression
  4. The quality of the final image

For instance, if you are posting a file to the Internet, the size of the file and the speed of decompression are more important than how long it takes to compress the file in the first place or the quality of the final image. That is not to say these last two are unimportant, just less important.

On the other hand, if you are streaming a live event, the speed of compression is most important, because if you can’t compress faster than real-time, no one will be able to watch the event.

As a third example, for a network television program, the speed of decompression and the quality of the final image are of paramount importance.

One last example, codecs are not just for moving images. BMP, PNG, TGA and TIFF are special codecs used to save and restore still images. They are designed to provide the highest image quality, but don’t compress or decompress image sequences in real-time.

As a sidelight, codecs are often divided into “lossy” and “lossless.” A lossless codec preserves all the original image quality so that when an image is restored it is indistinguishable from the original. TIFF and PNG are examples of a lossless codec.

 

A lossy codec “throws out” visual information as part of the compression process, which means that the compressed image does not have the original quality of the source. All video codecs are lossy.

No one codec provides the best of all four of these criteria. Each codec concentrates on maximizing one or two of the four. There is no such thing as a “perfect” codec, as different codecs were created to meet different criteria.

So Many Codecs, So Little Time

You’ve learned why there are so many codecs, however, Final Cut in some ways, makes selecting a codec even worse.

Final Cut started life as a QuickTime editor, the same way that Adobe Illustrator started life as a PostScript editor. Both rapidly evolved into something much more, but neither forgot their roots.

Final Cut supports all the codecs that QuickTime ever supported. And QuickTime supports all (or virtually all) its old codecs so that you can always play a QuickTime movie, no matter how old it is.

Examples of less used (and notice I did not say “unnecessary”) codecs include:

  • Cinepak
  • Component Video
  • Graphics
  • Apple Intermediate Codec
  • Apple Pixlet Video
  • Planar RGB
  • VC H.263
  • Video
  • Sorenson Video (but not Sorenson Video 3)

Now, before everyone starts shooting off emails, let me stress that for some applications in certain situations even these codecs can be indispensable. However, for general everyday video use, you may feel comfortable ignoring them.

Just for the record, not all codecs that Final Cut supports are for full-screen video. I’ve already mentioned graphics codecs like TIFF, PNG, BMP, and TGA.

There are also a lot of codecs specifically for the web. Web codecs are designed to reduce file size and decompress quickly, however, they take longer than real-time to compress:

  • H.261
  • MPEG-4
  • VC H.263
  • H.263
  • H.264
  • Sorenson Video 3
  • Sorenson Video
Choosing a Video Codec

As you are starting to see, the list of codecs we can use for video (fast compression and fast decompression) is starting to dwindle.

  • The first, and best, rule to keep in mind when choosing a video codec is to select the codec that matches the format of the video you are editing. Thus, if you are shooting NTSC DV, the DV/DVCPRO – NTSC codec is the best one to choose. (Outside the US, use the DV – PAL codec with your PAL DV video.)
  • The second rule is if you are selecting a codec to integrate multiple video formats choose the codec that provides the highest quality.
  • The third rule is to select your codec based upon your final output format.

These rules are made to be broken. However, before you start breaking rules willy-nilly, you should probably get a better understanding of what the impact is of selecting a specific codec.

In general, image quality increases with file size. As file size increases, you need bigger and faster hard disks; at some point, the files are so big they can’t be played from an external FireWire drive.

Here’s a table that ranks codecs from higher quality to lower for SD video. The rules are the same for HD, but the files are bigger. Data rates and storage for NTSC and PAL are essentially equivalent.

Codec Quality Approx.
data rate Space to store 1 hour of video Animation* Excellent 41 MB / second 147 GB Uncompressed 10-bit Very Good 26.7 MB / second 96 GB Uncompressed 8-bit Good 20.2 MB / second 72 GB DVCPro-50 Good 7 MB / second 25 GB DV OK 3.75 MB / second 13 GB

* The Animation codec supports video, but is not generally used for real-time playback.

Then there are specialized codecs that significantly compress video for off-line, low-resolution work that would not be used in the final version of the program:

  • Offline RT
  • Motion JPEG A
  • Motion JPEG B
  • Photo-JPEG
  • JPEG 2000
Choosing an HD codec

High-def (HD), in many ways, is less flexible than Standard-def. Here, you really need to choose a codec that matches the format of your camera.

Additionally, having a high-quality capture card is essential to support the higher-end HD formats. Also, increasingly, many camera manufacturers are creating proprietary formats which makes it very difficult to convert video from one format to another — the Sony XD/CAM series comes instantly to mind.

Conclusion

While there seem to be a lot of codecs to choose from, you can simplify your life by matching the codec to your video format. And don’t worry if you aren’t using lots of different codecs — most editors only work with a very few.


UPDATE – February, 2009

Rich Roddman, of CMR Studios, writes:

I have been doing a lot of web video that the is shot on green screen. I bring the files into Final Cut as Pro Res media @ 1920 x 1080. My final output will be 640 x 480. (I use the 1080 so I can adjust the size for wide shot to close ups and anywhere in between as needed) If I have my master timeline (Square pixels & Progressive) at 720 x 480 I can playback with an orange bar, but if I make the timeline 640 x 480 in get a red line and need to render to see anything. I don’t understand why the aspect ratio set at NTSC (4:3) causes a full render to be needed but NTSC DV (3:2) can playback?

Larry replies: Rich, my guess is that this is because 720 x 480 is a video format designed for real-time playback inside Final Cut, while 640 x 480 is a video format designed for the web that can be played back only after compression is complete.

[ Go to Top. ]


MORE PLAYBACK PROBLEMS

Derek Casari, of Fox Post, writes:

My question involves 1920 x 1080 resolutions. I had a couple of test clips made for me:

 

Here’s the deal. Only one file played back without motion artifacts when imported into just ProTools. That was the Apple Photo JPG at 170 mb/s. The other Apple Photo JPG at the higher data rate and the H.264 both showed artifacts. All of these were 24 fps and 1920 x 1080. I’m thinking that the data rates are the issue and maybe I’ll just have to empirically create a number of files to find one that plays back without problems, which seem to be temporal aliasing. BTW, is Apple Photo JPGA different than regular photo JPGA? I’m trying to avoid the GOP codecs because of the issues they have with sync and frame boundaries. Any suggestions on a codec AND data rate for playback of a QT movie imported into Protools at 1920 x 1080 would be a big help.

Larry replies: Derek, it depends upon how your video was shot.

Motion JPEG-A is designed to work with interlaced footage.

Photo-JPEG is designed to work with progressive images.

Both have a reasonably small data-rate, yet are easy to uncompress without taxing the playback system. This is critical because you want your computer to spend its time running ProTools, not in decoding compressed video.

H.264 uses GOP compression and requires serious computer horse-power to decode.

 

Comments
10 Comments to “Choosing the Best Video Codec”
  1. Hello, I was setting out today to output some clips out of FCP 7 in the Photo Jpeg Codec, but I have noticed a case of jitters… a slight frame delay that doesn’t exist in the original footage. Is there something I’m missing? Here’s the workflow:

    Original footage shot with Canon 7D (1920×1080 24)
    Converted to 1920 x 1080 unscaled Apple Pro Res 422
    Brought into FCP 7.0.3
    Sequence Setting 1440 x1080 HD (1440×1080) (16:9) Edit TB 23.98 Photo-JPEG 100%
    Editing on Mac Pro OS 10.7.4 6 GB

    I have also had the same result when I set my sequence setting to 1920 x 1080.

    Any help would be greatly appreciated…

    Andy

  2. Gary Hamilton says:

    I think your post is missing a critical piece of info:

    > Here’s a table that ranks codecs from higher quality to lower for SD video. The rules are the same for HD,
    > but the files are bigger. Data rates and storage for NTSC and PAL are essentially equivalent.

    Did you intend to have a link from the “Here’s a table”? I don’t see any table.

    Thanks,
    Gary

    • Gary Hamilton says:

      Forgot to mention: I’m trying to figure out which Codec to use in order to reduce the size of my video (which lasts just under 80min). Using the default Codec in FCPX 10.0.7 (Apple ProRes 422), the .mov file comes out to nearly 82 gig. I’m hoping to generate a decent-quality HD .mov in under 32 gig.

  3. Lucy Hannen says:

    Dear all, dear Larry,
    Thank yu so much for your helpful information!
    But still I’m trying to figure out the best and highest quality setting for exporting my movie, shot in 1920-1080, and will be screened quite big by a HD-ready beamer (1080-720).
    What would be the best codec then (indeed, I’m not seeing the list which Larry mentions above), H264?
    And is it sensible of me that I shoot the material 1920-1080, edit it in FCPX at the best quality (my project setting is also 1920-1080), while my beamer can’t handle tis, and thus will interlace the pixels?
    Can I better make my FCPX-projects 1080-720 in the first place?

    I would be very very thankful..
    Kind regards from The Netherlands
    Lucy Hannen

  4. Kathryn says:

    Hello,
    My video was heavily edited and layered and also contains several different sources including an HD camera.
    I am trying to upload it to a sky drive for easy sharing/emailing at the highest possible resolution.
    The size has to be 1920 x1080 HD.
    My question is, which is the best codec for me to use in this instance?

    Also, if I wanted to upload this movie to vimeo, what is the best codec?

    Thank you.

  5. John Curry says:

    Hi Larry… I do alot of info graphic bumpers and clips… the graphics are done at 1920 x 1080 in Illustrator or Photoshop and imported into FCP. What is the best format to save graphics for importing (jpeg, tiff etc?) and what is the best codec for out put. The peices get used both for presentation (projection) and attached to web content.

    Thanks for your help!!

  6. linu says:

    sir i am using a nikon d700 cam to take a pic.now i need to make a av file.so i used fcp for editing but in the fcp i cnt use the filter effects .bcse of the file size(4256 × 2832) its nt render .so i need to compress the jpeg file.but i dnt know how to compress .thn i need to use filter effects in that file .can u give me a solution sir

  7. JoeM says:

    Hello Larry,

    Thank you for all of your great info. I have a standard definition, NTSC, composite D2 master tape created in 1995 but not viewed since. If it will still playback, I am hoping to have it transferred to a hard drive, in a FCP 7 compatible format that will allow me to do some audio and color correction before exporting it to DVD for redistribution. Any thoughts as to which codec I should request it be converted to? Right now I’m thinking ProRes 422 HQ, but I’m uncertain. Thanks.

Trackbacks

Check out what others are saying...
  1. [...] Choosing the Best Video Codec by Larry Jordan [...]



Your thoughts are welcome

*


Larry Jordan & Associates, Inc
Video Editor
Experience Revolutionary Video Editing Techniques Through Final Cut Pro X Tutorials, Adobe Video Editing Classes, Final Cut Pro Classes, & A Variety of Other Software! Larry Jordan, Internationally - Renowned With 35+ Years Experience, Delivers Final Cut Pro Training & Other Software Via Live Webinars, Hosts Internet Radio, Podcasts, & More!
Los Angeles, CA
United States of America


Google Privacy Policy

Follow Larry

  • Facebook
  • Twitter
  • YouTube
  • Flickr
  • Google+