[英]Writing MJPEG to loopback device with FFMPEG fails on Ubuntu 20.04. Works on Rasperry Pi
I have a script that writes MJPEG from an HDMI video capture card (/dev/video0)
to a v4l2loopback device (/dev/video5)
.我有一个脚本,可以将 MJPEG 从 HDMI 视频捕获卡
(/dev/video0)
写入 v4l2loopback 设备(/dev/video5)
。 I compiled the v4l2loopback module from source .我从源代码编译了 v4l2loopback 模块。 This script works fine on Raspberry Pi but fails on Ubuntu with this error:
V4L2 output device supports only a single raw video stream
.此脚本在 Raspberry Pi 上运行良好,但在 Ubuntu 上失败并出现以下错误:
V4L2 output device supports only a single raw video stream
。 Is there a way around this or am I forced to transcode the HDMI capture output to rawvideo?有没有办法解决这个问题,或者我是否被迫将 HDMI 捕获 output 转码为原始视频? I would prefer to get this working on Ubuntu in the same way it is working on Raspberry Pi.
我更愿意以与在 Raspberry Pi 上工作相同的方式在 Ubuntu 上工作。
Here is the FFMPEG command:这是 FFMPEG 命令:
ffmpeg -input_format mjpeg -framerate 30 -s 1280x720 -i /dev/video0 -vcodec copy -f v4l2 /dev/video5
Full output of command:命令的完整 output:
Input #0, video4linux2,v4l2, from '/dev/video0':
Duration: N/A, start: 9137.845580, bitrate: N/A
Stream #0:0: Video: mjpeg (Baseline), yuvj422p(pc, bt470bg/unknown/unknown), 1280x720, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
[video4linux2,v4l2 @ 0x55eb0d461b40] V4L2 output device supports only a single raw video stream
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Stream mapping:
Stream #0:0 -> #0:0 (copy)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.