ffmpeg 有一个 -quality
使用选项 best
编码 VP9 时的设置, good
, 和 realtime
.这些选项如何影响其他可用的编码选项(例如 -speed
、 -slices
、 -frame-parallel
等...)?我在某处读到 -best
和 -good -speed 0
将提供大致相同的质量,而后者要快得多。对我来说,这听起来像是质量设置只是更改了其他选项(例如 -speed
),就好像它们只是预设一样,并且可以手动实现相同的结果。这是真的,还是质量设置会影响我无法使用其他选项更改的内容?
最佳答案
经过更多的在线搜索和一些 libvpx 代码的挖掘,我想我已经弄清楚了。似乎 ffmpeg -quality
命令与 -deadline
相同命令。这些命令不会直接影响其他选项,而只是确定允许编码器在任何特定帧上花费的时间量。正如 vpx_encoder.h
中的评论libvpx 代码中的文件:
The encoder supports the notion of a soft real-time deadline. Given a non-zero value to the deadline parameter, the encoder will make a "best effort" guarantee to return before the given time slice expires. It is implicit that limiting the available time to encode will degrade the output quality. The encoder can be given an unlimited time to produce the best possible frame by specifying a deadline of '0'. This deadline supercedes the VPx notion of "best quality, good quality, realtime". Applications that wish to map these former settings to the new deadline based system can use the symbols #VPX_DL_REALTIME, #VPX_DL_GOOD_QUALITY, and #VPX_DL_BEST_QUALITY.
预设质量的值在此文件中定义为:
- BEST = 0 Microseconds = Infinite
- GOOD = 1000000 Microseconds = 1 Second
- REALTIME = 1 Microsecond
默认设置为最佳。
关于ffmpeg VP9 - 质量设置有什么变化?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30451468/