4

当我们使用 HEVC + RTSP 时,ffmpeg 工作正常。流由网络摄像头捕获。

ffmpeg -f dshow -rtbufsize 100M  -f vfwcap -i "0" -strict experimental -c:v hevc_qsv -f rtsp -rtsp_transport tcp rtsp://127.0.0.1/live/test

输出如下:

frame=  355 fps= 37 q=-0.0 size=N/A time=00:00:11.27 bitrate=N/A dup=159 drop=0 speed=1.18x

然后我们切换到 VP9 + RTSP。

ffmpeg -f dshow -rtbufsize 100M  -f vfwcap -i "0" -strict experimental -c:v libvpx-vp9 -f rtsp -rtsp_transport tcp rtsp://127.0.0.1/live/test

fps 和速度看起来太慢了:

frame=  263 fps=9.5 q=0.0 size=N/A time=00:00:07.94 bitrate=N/A dup=119 drop=0 speed=0.288x

然后我们使用 ffplay 播放流。有很多错误消息,视频似乎冻结了。

[vp9 @ 000001c3da86c200] Not all references are available
[vp9 @ 000001c3dffd5700] Not all references are available
[vp9 @ 000001c3da8477c0] Not all references are available
[vp9 @ 000001c3da848240] Not all references are available
[vp9 @ 000001c3da848e40] Not all references are available
[vp9 @ 000001c3e01d2fc0] Not all references are available
[vp9 @ 000001c3e01dd280] Not all references are available
[vp9 @ 000001c3e01e8980] Not all references are available
[vp9 @ 000001c3e01f1880] Not all references are available
[vp9 @ 000001c3da86c200] Not all references are available
[vp9 @ 000001c3dffd5700] Not all references are available
[vp9 @ 000001c3da8477c0] Not all references are available
[vp9 @ 000001c3da848240] Not all references are available
[vp9 @ 000001c3da848e40] Not all references are available
[vp9 @ 000001c3e01d2fc0] Not all references are available
[vp9 @ 000001c3e01dd280] Not all references are available0B f=0/0
[vp9 @ 000001c3e01e8980] Not all references are available
[vp9 @ 000001c3e01f1880] Not all references are available
[vp9 @ 000001c3da86c200] Not all references are available
[vp9 @ 000001c3dffd5700] Not all references are available
[vp9 @ 000001c3da8477c0] Not all references are available
[vp9 @ 000001c3da848240] Not all references are available
[vp9 @ 000001c3da848e40] Not all references are available
[vp9 @ 000001c3e01d2fc0] Not all references are available
[vp9 @ 000001c3e01dd280] Not all references are available
[vp9 @ 000001c3e01e8980] Not all references are available
[vp9 @ 000001c3e01f1880] Not all references are available

最后,我们尝试硬件 VP9 编码器。

ffmpeg -f dshow -rtbufsize 100M  -f vfwcap -i "0" -strict experimental -c:v vp9_qsv -f rtsp -rtsp_transport tcp rtsp://127.0.0.1/live/test

它行不通。

[swscaler @ 0000021e88df9fc0] deprecated pixel format used, make sure you did set range correctly
[vp9_qsv @ 0000021e8687df80] Selected ratecontrol mode is unsupported
[vp9_qsv @ 0000021e8687df80] Low power mode is unsupported
[vp9_qsv @ 0000021e8687df80] Current frame rate is unsupported
[vp9_qsv @ 0000021e8687df80] Current picture structure is unsupported
[vp9_qsv @ 0000021e8687df80] Current resolution is unsupported
[vp9_qsv @ 0000021e8687df80] Current pixel format is unsupported
[vp9_qsv @ 0000021e8687df80] some encoding parameters are not supported by the QSV runtime. Please double check the input parameters.
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!

那么,我们怎样才能成功的处理VP9+RTSP呢?

4

1 回答 1

2

我绝不是这方面的权威,但我和你的情况相似。如果我正确理解这个 GitHub 问题,那么“第 9 代”英特尔GPU——维基百科的“Kaby Lake、Coffee Lake、Whiskey Lake、Comet Lake” ,我认为对应于 7xxx 到 10xxx——具有对 VP9 编码的硬件支持,但 Windows 驱动程序并未公开此功能以供 Media SDK 使用。我认为我们看到的错误消息反映了 QSV 编码在我们的特定 CPU 型号和操作系统上不可用的事实。

出于某种原因,该功能在 Linux上可用。我已经看到几个消息来源说 VA API ( vp9_vaapi) 应该可以在这些“第 9 代”处理器中的任何一个上工作。QSV 驱动程序 ( vp9_qsv) 也可能在 Linux 中工作。我还没有机会尝试。

于 2021-01-04T12:03:17.347 回答