Ratecontrol

Ratecontrol, in H.264/AVC parlance, means the application of a variety of methods to overall constrain the bitrate of content or consistency of perceptual quality across the entirety of the encode.

For users interested in a constant visual quality, crf (constant rate factor) should be utilized. The typical value for content to be perceived as visually lossless is near 18. Lower numbers will result in higher visual quality but larger file sizes.

The constant quantizer mode is not frequently used, and disables much of the adaptive perceptual features in AVC. It is available for solutions that require it.

The default, average bitrate control, utilizes larger and smaller bitrates over time to achieve an overall bitrate as close to the requested bitrate as possible. It is possible to add VBV parameters like vbv-maxrate and vbv-bufsize to precisely control the maximum bitrate over a given time duration, which can be useful when creating adaptive bitrate manifest-based content like HLS and DASH. Reach out to our support engineers for advice on choosing these parameters if you have a scenario requiring them.

ParameterDescriptionAllowed ValuesDefault Value
cqpEnable constant quantizer mode.Positive Integernone
crfEnable constant quality mode (also known as constant ratefactor).Floatnone
qminSpecify the minimum quantizer.Positive Integer10
qmaxSpecify the maximum quantizer.Positive Integer50
qdiffSpecify the maximum QP step.Positive Integer4
btSpecify the allowed variance of average bitrate.Positive Integernone
i_qfactorSpecify the qscale difference between I-frames and P-frames.Float0.71
b_qfactorSpecify the qscale difference between P-frames and B-frames.Floatnone
chromaoffsetSpecify the QP difference between chroma and luma.Positive Integernone
passSpecify how many encoding passes.1, 2, 3none
rc_eqSpecify the ratecontrol equation.StringblurCplx^(1-qComp)
qcompSpecify the QP curve compression: 0.0 => CBR, 1.0 => CQP.Float0.60
complexityblurReduce fluctuations in QP (before curve compression).Float20.0
qblurReduce fluctuations in QP (after curve compression).Float0.5
rc-lookaheadNumber of frames to use for mb-tree ratecontrol and vbv-lookaheadInteger number between 0 and 250none