[FFmpeg-user] libvpx encoding CBR does not work

James Lu luj125 at gmail.com
Tue Sep 20 19:39:16 CEST 2011

On Tue, Sep 20, 2011 at 5:57 AM, Rapsey <rapsey at gmail.com> wrote:

> Hello,
> I'm trying to encode a file to .webm, with constant bitrate, but it pretty
> much ignores whatever I set for bitrate. What am I doing wrong?
> ffmpeg -i aerobika.avi -vcodec libvpx -maxrate 500k -minrate 500k -b 500k
> -bt 500k -quality realtime  -acodec libvorbis -ab 128k -threads 0 -f
> matroska -y aerobika.webm
> Sergej
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user

Hey Sergej,

In my experience with encoding into webm video , I've had to use the
webmproject.org tool vpxenc. For some reason, the mappings of the -b ffmpeg
parameter doesn't match to libvpx's bitrate control options. Using vpxenc,
the command line you would want to use seems like:

ffmpeg -i aerobika.avi -an aerobika.y4m
vpxenc --end-usage=cbr --target-bitrate=500 --rt --threads=0
--output=video.webm aerobika.y4m
ffmpeg -i aerobika.avi -vn -acodec libvorbis -aq 4 -threads 0 audio.ogg
mkvmerge aerobika.avi audio.ogg video.webm

Notes on the commands:
1) Vorbis uses aq commands, the mapping of aq to ab can be found at
2) After generating the audio and video seperatly, you need to combine
without reencoding; this is done using mkvmerge tool found here:

I haven't checked the bug lists for this particular oddity, but it would
help if you submitted one or confirmed an existing report.

Hope this helps!


More information about the ffmpeg-user mailing list