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


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
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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s