我有一个带有 V1 摄像头的 RaspberryPi。
我想将它用作 Zoom、Teams 和其他虚拟 session 的摄像头。
我使用名为“Motion”的应用程序通过 http 获得 RaspberryPi 流式运动 JPEG。
我在我的 linux 笔记本电脑上创建了一个 v4l2 虚拟设备作为虚拟相机。
但是,我无法使用简单的命令让 mjpeg 流播放到 v4l2 虚拟设备:ffmpeg -i "http://milan.local:8081" -map 0:v -f v4l2 /dev/video4
结果是:
Input #0, mpjpeg, from 'http://milan.local:8081':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 640x480 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (mjpeg (native) -> rawvideo (native))
Press [q] to stop, [?] for help
[v4l2 @ 0x55a04567bbe0] Unknown V4L2 pixel format equivalent for yuvj420p
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:0 --
我的
ffmpeg
命令缺少哪些选项?
最佳答案
添加 -vf format=yuv420p
或 -vf format=yuyv422
输出选项:
ffmpeg -i "http://milan.local:8081" -vf format=yuv420p -f v4l2 /dev/video4
关于ffmpeg - 将 MJPEG 流播放到 v4l2loopback 设备,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63125118/