Why does FFMPEG always make large WebM files?

心不动则不痛 提交于 2019-12-03 06:30:06

libvpx is a little complicated with regard to rate control and quality settings. Please refer to the vpx Encoding Guide and the VP8 Encode Parameter Guide for more info. It took me an hour of digging through the source code to understand it.

If you want to set constant bitrate, you will have to set b:v, maxrate and minrate to the same values, for example like so (note that I left out the audio options here for brevity):

ffmpeg -i input.mov -c:v libvpx -b:v 1900K -maxrate 1900K -minrate 1900K output.webm

If instead you want to use variable quality and just specify the upper bound for the bitrate, then you need to set both b:v and crf. If you leave out crf, the specified bitrate will just be taken as an average. Only with crf, the encoder changes the meaning of b:v to the maximum allowed rate.

ffmpeg -i input.mov -c:v libvpx -b:v 1900K -crf 10 output.webm

A value of 10 for the CRF is a good starting point, but libvpx may change the quality per frame within the bounds of qmin ≤ q ≤ qmax, which you can also specify if you want. Setting a lower bound of 10 for qmin seems a little high to me, but in essence you'll have to do some trial and error anyway, since if the maximum bitrate is too low, you'll constantly saturate it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!