Learn More Contact Now
supercharging-compressor.pngYou can find more compression settings articles in our Supercharging Compressor series index.

Note: There's something about me and GOP articles ... just as I did on the first part of this article, I seem to have accidentally published a blank draft a few hours ago.  This is the finished version.  My apologies.

Compressor, like most reasonably advanced MPEG2 compression tools, offers you some control over the size and structure of your GOPs.  You'll recall from the first part of this article that 15-frame (1/2-second) GOPs are the norm for MPEG-2 video, and this is appropriate for a wide range of video types.  Similarly, Compressor defaults to using a lot of "B"-frames -- those are the frames that take the least information to represent, but that depend most heavily on neighboring frames of video.

Read on for situations when you might want to change this around ...

I've been grasping for a visual aide for this article, and Nick Kingsbury has been kind enough to license a helpful diagram for public use:

mpeg-gop-figure.pngThis isn't as complicated as it looks: remember that a GOP is the chunk of frames between one I-frame and the next.  Now, think of that top diagram kind of like a timeline, moving frame by frame from left to right.  Think of the vertical stack of frames kind of like layers in a sequence, with the "fattest," least efficient "I" frames on top, and the lightest frame types on the bottom.  When an arrow is pointing from one frame to another, that means that the second frame is relying on portions of the first frame (say, a background that's not moving) when it does its compression.

GOP Size
Notice that "I"-frames don't depend on any other frames for portions of their picture.  Notice also that, in the "typical" GOP on the diagram, "I" frames are spaced widely.  From a compression standpoint, this makes sense -- "I" frames cost a lot of precious bits to encode -- but it can really harm the quality of quickly-changing video.  We can see this in the diagram: follow the arrows forward from an I-frame.  If, say, the camera is panning or the video is transitioning, a frame 12 frames down from the previous I-frame will look bad when it's still trying to use pieces of that original I-frame.

This is where the GOP Size control can come in handy.  If you know your video will be changing quickly, use a smaller default GOP size: you'll get less overall quality for the bitrate you choose, but you'll get a lot more in the "rough spots" where it counts.

Video types where a smaller GOP size might help include:
  • Sports footage
  • Transition-heavy sequences
  • Footage with heavy camera motion

GOP Structure
Once you've used GOP size to decide how closely to space your I-frames, the GOP Structure controls let you decide how you want your "P" and "B" frames to work.  Look back at those arrows: "P" frames only look back at the previous "I" frame, while "B" frames borrow chunks of the frames behind them AND ahead of them.  Knowing this can be helpful in "directional" changes in video: consider a fade to black. 

Say the "I"-frame is placed at the beginning of the fade.  The first "P" frame will look back to that original frame, and change how dark the present frame is accordingly.  The next "P" frame will look back to the original frame, and to the previous "P" frame, and effectively say "Hey, each chunk of video is a little darker -- the best way to compress this is to take that slightly-darker chunk and make it darker still." 

A "B" frame, though, can look in both directions, and it may choose to use darker parts of the fade for some chunks of the video while looking back to lighter parts for other chunks.  When that happens, the end result is the "blocky" fade we're so familiar with.

Compressor offers you a couple of different basic GOP structures; the basic difference is whether the structure uses one or two "B" frames for each "I" or "P."  The pattern that uses only one "B" frame, which starts "IBP," can handle directional video better, but, as with GOP size, it comes with a tradeoff.  By giving up those super-efficient "B" frames, you get less overall quality for the bitrate that you're using -- but once again, you gain quality where it counts.

The "IBP" structure is likely to help the following types of video:
  • Fades to or from a solid color
  • Footage with heavy camera motion
  • (Sometimes) footage with lots of transitions


I hope this helps, but I know that I get carried away with the geeky stuff on compression sometimes.  As always, I encourage you to email me if you found this article hopelessly unclear -- or if you have any MPEG-2 tips that you wouldn't mind sharing with the GeniusDV community!



Selected References:
track.backs

Listed below are 0 links to blogs that reference this entry: Advanced GOP-ology.

TrackBack URL for this entry: http://www.geniusdv.com/weblog/mt-tb.cgi/1055

Receive FREE Tutorials by email:

HANDS-ON COURSES in ORL

ONLINE VIDEO COURSES
    Avid Media Composer Training
  • Enrollment Cost: $50.00
  • 84 Media Composer Lectures
  • Includes Practice Media
  • Interactive Quizzes
  • Official Certificate of Completion
  • 30 Day Money Back Guarantee
  • Click to Enroll for 10% off!
    Final cut Pro X Training
  • Enrollment Cost: $39.00
  • 60 Final Cut Pro X Lectures
  • Includes Practice Media
  • Interactive Quizzes
  • Official Certificate of Completion
  • 30 Day Money Back Guarantee
  • Click to Enroll for 10% off!

about.this

Creating Title Text in Final Cut Pro was the previous entry in this blog.

Convert photos to 3D scenes in Photoshop CS4 - Part 1 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.