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:

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s