ffmpeg VP9 - 质量设置有什么变化?

ffmpeg VP9 - What do the quality settings change?

ffmpeg 在使用选项 bestgoodrealtime 编码 VP9 时有一个 -quality 设置。这些选项如何影响其他可用的编码选项(例如 -speed-slices-frame-parallel 等)?我在某处读到 -best-good -speed 0 将提供大致相同的质量,后者更快。对我来说,这听起来像是质量设置只是更改其他选项(例如 -speed),就好像它们只是预设,并且可以手动获得相同的结果。这是真的吗,还是质量设置会影响我无法通过其他选项更改的内容?

在网上进行了更多搜索并深入研究了 libvpx 代码之后,我想我已经弄明白了。看来ffmpeg -quality 命令和-deadline 命令是一样的。这些命令不直接影响其他选项,而只是确定允许编码器在任何特定帧上花费的时间量。正如 libvpx 代码中 vpx_encoder.h 文件中所评论的:

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

默认设置为最佳。