To those that are new to video compression and encoding, there may be a setting you might not know about, or are unfamiliar with if you have seen it. It’s the “keyframe” setting in many video encoding applications.
A video compression keyframe has nothing to do with an animation keyframe, so let’s get that out of the way first. When encoding video for the web, or anything that needs small files while maintaining decent visual quality, keyframes can be your secret weapon. Think of video compression keyframes as your reference frames to which all successive frames will be based on. This way, those successive frames don’t need to “recreate” the entire frame of visual data, only what has changed from the keyframe.
So if you had a keyframe for every frame (a value of “1”), you’d essentially have no keyframes and your file size would be huge. If you’re gunning for maximum quality without worry of file size, then definitely set your keyframe to 1.
If you set your keyframe value to 240 (and your video was 24 FPS), then you’d have a keyframe every 10 seconds. This is great for talking head type videos where there isn’t a lot of change in the picture. This will surely help produce smaller file sizes while maintaining quality.
If you’re somewhere in the middle with fast moving elements in the picture, then you’ll probably want to have a value somewhere between 48 and 96 (again, if you’re running at 24 FPS). That will give you a keyframe between 2 seconds and 4 seconds, respectively.
Like any digital art form, you need to play with it to get the best results you’re looking for. Maybe do 10 or 20-second sample tests before you encode your 3-hour feature length masterpiece.