从第二台电脑捕获原始视频流(HDMI 分配器和捕获卡)

从第二台电脑捕获原始视频流(HDMI 分配器和捕获卡)

我想创建一个测试设置,其中我通过 HDMI 分配器从一台 PC 传输原始流,并将其显示在第二台 PC 上,在第二台 PC 上使用采集卡接收 HDMI 信号。由于测试,对我来说,尽可能以未压缩或无损的方式传输流,并以尽可能小的延迟显示在第二台 PC 上,这一点很重要。

由于我想稍后调整帧速率、压缩等参数,我考虑过使用 ffmpeg 从采集卡捕获流。但是,我目前在显示的流上仍然有明显的延迟。

到目前为止,我尝试使用 SDL 显示它并将其传输到 ffplay,其中 SDL 在延迟/等待时间方面产生了更好的结果。但为了使用 SDL 显示它,我不得不将像素格式更改为 yuv420p,因为不知何故 SDL 似乎无法处理原始输入。

我的 FFmpeg 命令使用 SDL 显示它看起来像这样:

ffmpeg -rtbufsize 2G -f dshow -i video="Blackmagic WDM Capture (4)" -vf format=yuv420p -f sdl -

当使用 SDL 显示时,它也可以使用较小的缓冲区大小,但由于在将其传输到 ffplay 时遇到缓冲区问题,因此我在某个时候将缓冲区大小增加到 2G。

当将其传输到 ffplay 时,我遇到了性能问题,而且我的缓冲区不知何故随着时间的推移而填满。也许这是硬件问题,我的 CPU、RAM 或磁盘速度不够快?

我还尝试使用与上面相同的像素格式,以使其更好地进行比较:

ffmpeg -rtbufsize 2G -f dshow -i video="Blackmagic WDM Capture (4)" -vf format=yuv420p -f rawvideo - | ffplay -f rawvideo -pixel_format yuv420p -video_size 1920x1080 -

例如,从命令行输出显示实时缓冲区随着时间的推移而填满:

> Input #0, rawvideo, from 'fd:':    0KB vq=    0KB sq=    0B f=0/0   =N/A
  Duration: N/A, start: 0.000000, bitrate: 622080 kb/s
  Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1920x1080, 622080 kb/s, 25 tbr, 25 tbn
[dshow @ 000002347d9cc880] real-time buffer [Blackmagic WDM Capture (4)] [video input] too full or near too full (63% of size: 2000000000 [rtbufsize parameter])! frame dropped!
    Last message repeated 2 times  0KB vq=18225KB sq=    0B f=0/0
[dshow @ 000002347d9cc880] real-time buffer [Blackmagic WDM Capture (4)] [video input] too full or near too full (64% of size: 2000000000 [rtbufsize parameter])! frame dropped!
    Last message repeated 1 times  0KB vq=18225KB sq=    0B f=0/0
[dshow @ 000002347d9cc880] real-time buffer [Blackmagic WDM Capture (4)] [video input] too full or near too full (65% of size: 2000000000 [rtbufsize parameter])! frame dropped!
    Last message repeated 1 times  0KB vq=15187KB sq=    0B f=0/0
[dshow @ 000002347d9cc880] real-time buffer [Blackmagic WDM Capture (4)] [video input] too full or near too full (66% of size: 2000000000 [rtbufsize parameter])! frame dropped!
[dshow @ 000002347d9cc880] real-time buffer [Blackmagic WDM Capture (4)] [video input] too full or near too full (67% of size: 2000000000 [rtbufsize parameter])! frame dropped!
    Last message repeated 1 times  0KB vq=18225KB sq=    0B f=0/0
[dshow @ 000002347d9cc880] real-time buffer [Blackmagic WDM Capture (4)] [video input] too full or near too full (68% of size: 2000000000 [rtbufsize parameter])! frame dropped!
    Last message repeated 1 times  0KB vq=18225KB sq=    0B f=0/0
[dshow @ 000002347d9cc880] real-time buffer [Blackmagic WDM Capture (4)] [video input] too full or near too full (69% of size: 2000000000 [rtbufsize parameter])! frame dropped!
[dshow @ 000002347d9cc880] real-time buffer [Blackmagic WDM Capture (4)] [video input] too full or near too full (70% of size: 2000000000 [rtbufsize parameter])! frame dropped!

我接下来想尝试的是,在具有“更好”硬件的 PC 上尝试同样的操作,看看情况是否有所改善。我还考虑过使用无损压缩而不是原始视频,因为最终我想要的“参考”只需要视觉上无损即可。

在此先感谢您对我如何改进流程或其他可能更好的解决方案提出的任何建议。

相关内容