[FFmpeg-user] libvpx encoding CBR does not work

Marcos Felipe Rasia de Mello marcosfrm at gmail.com
Tue Sep 20 22:16:15 CEST 2011

2011/9/20 James Lu <luj125 at gmail.com>:
> 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:

It should, because setting "minrate = maxrate = vb" enable libvpx
VPX_CBR encoding mode.

> 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

You can also use pipe:
ffmpeg -i input.xxx -pix_fmt yuv420p -f yuv4mpegpipe - 2>/dev/null |
vpxenc <options> - -o video.webm

For audio too:
ffmpeg -i input.xxx -f wav - 2>/dev/null | oggenc -b 96 --ignorelength
- -o audio.ogg

> Notes on the commands:
> 1) Vorbis uses aq commands, the mapping of aq to ab can be found at
> http://en.wikipedia.org/wiki/Vorbis#Technical_details
> 2) After generating the audio and video seperatly, you need to combine
> without reencoding; this is done using mkvmerge tool found here:
> http://www.bunkus.org/videotools/mkvtoolnix/
> 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!
> ~James



More information about the ffmpeg-user mailing list