如何使用 FFMPEG 获得最佳的 FLV 整体质量?
我希望以最小的文件大小实现最佳质量的 FLV。毕竟,这不是每个人的目标吗?如果这有什么影响的话,这些视频将会被直播。
目前,我的视频宽度不超过 320 像素,有些是宽屏,因此它们的高度略小于 240 像素。就目前情况而言,转换后的 FLV 的质量相当差。
当前命令:
> ffmpeg -i video.mov -ar 22050 -ab 32 -f flv -s 320x240 -aspect 4:3 video.flv
I'm looking to accomplish the best quality FLV with the lowest file size. After all, isn't that everyone's goal? These videos will be streamed if that makes any difference.
For now, my video(s) are no wider than 320px, and some are widescreen, so their heights are a little smaller than 240px. As it stands, the quality of the converted FLVs is quite poor.
Current command:
> ffmpeg -i video.mov -ar 22050 -ab 32 -f flv -s 320x240 -aspect 4:3 video.flv
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
默认情况下,flv 默认为 200Kb,qmax 高达 30(因为您没有覆盖它),它可能会产生接近该值的输出。
您可以通过以下任一方法解决此问题:
在测试视频上,我刚刚尝试 -qmax 10 给出了可接受的输出。
使用 qmax 和 qmin 设置可接受质量的下限和上限是首选方法。
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:
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.
到目前为止,我对所提供的选项没有任何运气 - 其中大多数对我的输入文件没有影响,该文件始终产生质量差的结果 - 但以下确实效果很好:
减少 qscale 值以获得更好的质量,增加它以获得较小的文件大小。来自文档:
在 Mac OS X 10.6.8 上测试。
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:
Reduce the qscale value for better quality, increase it for a smaller file-size. From the docs:
Tested on Mac OS X 10.6.8.
我认为最大化质量/大小比率的最佳解决方案是完全废弃 ffmpeg 的“flv”编码,并使用 H.264。
我通常使用 handbrake 将文件转换为 MP4/AAC,然后仅使用 FFMPEG 将文件重新混合到 FLV 容器中。
手刹也有很多参数,一些有趣的预设可以在这里找到:http://trac. handbrake.fr/wiki/BuiltInPresets
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.
There are also a lot of parameters for handbrake, some interesting presets can be found here: http://trac.handbrake.fr/wiki/BuiltInPresets