[FFmpeg-user] Encoding CBR with libx264

Werner Robitza werner.robitza at gmail.com
Thu Feb 5 22:36:28 CET 2015


On Thu, Feb 5, 2015 at 7:18 PM, Sareyka, Julian <Julian.Sareyka at br.de> wrote:
> Hello all,
>
> I am trying to encode video for adaptive streaming and need CBR for that. So I use the -b:v, -minrate, -maxrate, -bufsize settings.
> But in the end I get a lower video bitrate as configured. With this command I end up with 3200 kb/s instead of 3500 kb/s:
>
> ffmpeg -y -i 14d7077e-0822-4ab4-ba7f-822df1874936.mp4 -vf scale=1280:720  -pix_fmt yuv420p -c:v libx264 -aspect 16:9 -profile:v high -level 3.2 -r 25 -g 50 -keyint_min 50 -sc_threshold 0 -b:v 3500k -minrate 3500k -maxrate 3500k -bufsize 7000k -c:a libfdk_aac -b:a 192k -ar 48k -ac 2 test.mp4

Playing the devil's advocate here: Does it really matter? :)

The minrate setting should work, but it entirely depends on the
bufsize. See also:
http://trac.ffmpeg.org/wiki/Limiting%20the%20output%20bitrate
I was getting 3500k exactly when setting the bufsize to 10000k. It's
all a matter of how big the window for calculating the bit rate budget
is.


More information about the ffmpeg-user mailing list