How can I achieve the best overall FLV quality with FFMPEG?

巧了我就是萌 提交于 2019-12-02 18:29:34

By default flv defaults to 200Kb and with the qmax being as high as 30 (since you're not overriding it) it'll probably be producing output near that. You can fix this by either:

  • Setting qmax to a lower value forcing the quality control to up the birate to meet the requirement.
  • Upping the bitrate with -vb 400k

On the test video I just tried -qmax 10 gave acceptable output. Using qmax and qmin to set the lower and upper acceptable quality is the preferred way.

I didn't have any luck with the options presented thus far - most of them had no effect on my input file, which was consistently producing poor-quality results - but the following worked very well indeed:

ffmpeg -qscale 4 -i infile.avi outfile.flv

Reduce the qscale value for better quality, increase it for a smaller file-size. From the docs:

-qscale n where n is a number from 1-31, with 1 being highest quality/largest filesize and 31 being the lowest quality/smallest filesize.

Tested on Mac OS X 10.6.8.

I think the best solution to maximize the ratio quality/size is to scrap the "flv" encoding of ffmpeg altogether, and use H.264 instead.

I'm usually using handbrake to convert files to MP4/AAC, and then only use FFMPEG to remux the file into an FLV container.

ffmpeg -i input_file.mp4 -vcodec copy -acodec copy -y output_file.flv

There are also a lot of parameters for handbrake, some interesting presets can be found here: http://trac.handbrake.fr/wiki/BuiltInPresets

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