沉入虚拟v4l2设备

问题描述 投票:1回答:1

我曾在Ubuntu 19.04上尝试过example

gst-launch-1.0 videotestsrc ! v4l2sink device=/dev/video10

但是gstreamer失败

Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0: Cannot identify device '/dev/video10'.
Additional debug info:
v4l2_calls.c(609): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0:
system error: No such file or directory
Setting pipeline to NULL ...
Freeing pipeline ...

为什么不起作用?我在文档中没有找到这个,是否需要以某种方式创建/ dev / video10?

我对默认设备/ dev / video1做了同样的操作,但它是我的笔记本电脑上的输入摄像头设备:

sudo gst-launch-1.0 videotestsrc ! v4l2sink 
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0: Device '/dev/video1' is not a output device.
Additional debug info:
v4l2_calls.c(639): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0:
Capabilities: 0x4a00000
Setting pipeline to NULL ...
Freeing pipeline ...

提前感谢。

linux gstreamer
1个回答
0
投票

您的问题的标题表明您想写入虚拟视频设备。 v4l2设备可以是输入和输出视频设备。您的相机是视频输入(捕获)设备。在gstreamer中引导v4l2sink(因此是管道的端点)可能会失败。

但是您可以生成虚拟输出设备。您正在寻找的是v4l2-loopback设备。它允许您生成虚拟/dev/video10设备,如下所示:

modprobe v4l2loopback video_nr=10
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.