FFmpeg H.264 Constant Bitrate (CBR) Encoding

Example command using a single-frame VBV:

ffmpeg -i <input> -r 25 -c:v libx264 -x264opts nal-hrd=cbr:force-cfr=1 -b:v 2500k -minrate 2500k -maxrate 2500k -bufsize 100k output.ts

where:

nal-hrd=cbr set the hypothetical reference decoder (HRD) to CBR and pack the bitstream to the specified bitrate
force-cfr=1 force constant framerate timestamp generation
-b:v the video bitrate
-minrate
-maxrate
same as the video bitrate for constant bitrate
-bufsize the video buffering verifier (VBV) buffer size, set for capped frame-size encoding (bufsize = bitrate / framerate)

Additional notes:

One thought on “FFmpeg H.264 Constant Bitrate (CBR) Encoding

Leave a comment