使用 v4l2loopback 和 openframeworks 创建虚拟相机

问题描述

我想创建一个虚拟网络摄像头。当我运行我的程序时出现此错误

[ error ] ofGstUtils: gstHandleMessage(): embedded video playback halted for plugin,module capsfilter1  reported: Filter caps do not completely specify the output format

我已经用这个命令设置了我的虚拟相机:

sudo modprobe v4l2loopback card_label="robotechnicCam" exclusive_caps=1

我使用了一个 ofxGstV4L2Sink 的叉子,你可以找到 here

这是命令的输出

v4l2-ctl --all -d 2 
Driver Info:
        Driver name      : v4l2 loopback
        Card type        : robotechnicCam
        Bus info         : platform:v4l2loopback-000
        Driver version   : 5.11.11
        Capabilities     : 0x85208002
                Video Output
                Video Memory-to-Memory
                Read/Write
                Streaming
                Extended Pix Format
                Device Capabilities
        Device Caps      : 0x05208002
                Video Output
                Video Memory-to-Memory
                Read/Write
                Streaming
                Extended Pix Format
Priority: 2
Video output: 0 (loopback in)
Format Video Output:
        Width/Height      : 8192/8192
        Pixel Format      : 'YVYU' (YVYU 4:2:2)
        Field             : None
        Bytes per Line    : 16384
        Size Image        : 134217728
        Colorspace        : sRGB
        Transfer Function : Default (maps to sRGB)
        ycbcr/HSV Encoding: Default (maps to ITU-R 601)
        Quantization      : Default (maps to Limited Range)
        Flags             : 
Streaming Parameters Video Capture:
        Frames per second: 30.000 (30/1)
        Read buffers     : 2
Streaming Parameters Video Output:
        Frames per second: 30.000 (30/1)
        Write buffers    : 2

User Controls

                    keep_format 0x0098f900 (bool)   : default=0 value=0
              sustain_framerate 0x0098f901 (bool)   : default=0 value=0
                        timeout 0x0098f902 (int)    : min=0 max=100000 step=1 default=0 value=0
               timeout_image_io 0x0098f903 (bool)   : default=0 value=0

如果我这样做:

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

或者那个:

ffmpeg -re -i ./test.mp4 -f v4l2 /dev/video2

它工作得很好,我不知道为什么我的代码不能按预期工作。

感谢您的帮助

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...