我想创建一个虚拟网络摄像头。当我运行我的程序时,我遇到了这个错误:
[ 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的一个分支,你可以在这里找到
这是命令的输出:
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
它工作得很好,我不知道为什么我的代码不能按预期工作。
谢谢你的帮助