[Jerry Smith] “The thing that really seems to affect the file size is the keyframe distance.”
[Jerry Smith] “QUESTION 1: Why is the optimum keyframe distance of roughly 300 so much bigger than the 30 frame time scale indicated by changes?”
Interframe compression like H.264 works by eliminating visual redundancy over time. These schemes store two kinds of frames in the stream: complete frames (keyframes or I-frames) that contain all the image information for one frame in one place, and partial frames (B-frames and P-frames) that only contain change information must refer to other frames in the stream to reconstitute the image for that frame.
This is a tradeoff between size (the partial frames use less data and the I-frames use more) and quality/complexity (a single I-frame stands alone and is easy to decode, while B- and P-frames require processing several frames and may accumulate more artifacts because of tight encoding constraints).
When you explicitly set an H.264 keyframe distance, you are telling the compressor how often to place I-frames into the stream. When keyframes are placed closer together, you force the compressor to store more complete frames in the stream, whether it actually needs to or not. A complete picture takes up a lot more space than a little note that says “nothing has changed since the last frame.”
[Jerry Smith] “QUESTION 2: If you are choosing a keyframe for all devices, what do you choose? This is something you hear all the time now: video available on all platforms on all devices. It’s not easy to just play trial and error any longer since the creator has no idea really where it is going to be played back. In this case, would you just choose the last option?”
Services like Vimeo and YouTube actually re-encode your media into several different streams with different resolution and quality/bit rate targets. This allows the player to switch among them according to bandwidth and user preference.
I only consider manual keyframe control in specific circumstances, where I know exactly how the original file will be used.
Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive | RenderBreak [blog] | Profile [LinkedIn]