I gathered the following rate control algorithms are commonly used when encoding modern video formats like h264, HEVC or VP9.
- With a constant quantizer (
-qp
in terms offfmpeg
) all frames are encoded with the same compression ratio. Any still frame one would extract from the resulting video should come out to the same visual quality, regardless of how movement-intense or complex of a scene it is from. - A constant rate factor (the
-crf
parameter) applies more compression to complex parts to in turn leave simple scenes relatively uncompressed. Thus more artifacts are introduced in e.g. quick moving shots, which in common application is less noticeable to the human eye, achieving a good subjective quality while saving on file size. - The third variant is to target a specific file size with two passes of variable bitrate (
-b
). The first pass collects data on each frame, so that the second pass then can allocate more bits to the parts of the video that are hard to retain quality otherwise. This effectively does the inverse of CRF, assigning more quality to complex scenes.
I am looking for a strategy to archive videos wherein the movement-heavy scenes are actually most important, may even be stopped, zoomed in on and analyzed for details, whereas slow or static content is less of interest. Am I right to look to two-pass VBR to achieve the best encoding in this regard?
Should my understanding of any of the above methods be mislead in the first place, feel free to correct me. Other hints for encoding movement with good quality are also appreciated. I am especially unsure whether two-pass variable bitrate indeed leads to a heavier distribution of bitrate towards quick scenes and would appreciate if someone could confirm this with any documentation.