我正在尝试使用下一个代码运行测试管道:
cv::VideoCapture cap(" videotestsrc ! videoconvert ! appsink0 ",cv::CAP_GSTREAMER);
它没有启动,并且根据GStreamer Videocapture的调试信息,使用文件filerc和uridecodebin填充了我的管道:
0:00:00.109716345 416 00482000 INFO GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "uridecodebin"
0:00:00.115115124 416 00482000 INFO GST_ELEMENT_FACTORY gstelementfactory.c:359:gst_element_factory_create: creating element "filesrc" named "source"
0:00:00.115201864 416 00482000 INFO GST_ELEMENT_PADS gstelement.c:669:gst_element_add_pad:<GstBaseSrc@00549648> adding pad 'src'
0:00:00.115231992 416 00482000 INFO filesrc gstfilesrc.c:261:gst_file_src_set_location: filename : C:\Users\Yumatov\Documents\build-testgstopencv-Desktop_Qt_5_12_2_MinGW_32_bit-Debug\ videotestsrc ! videoconvert ! appsink0
0:00:00.115252518 416 00482000 INFO filesrc gstfilesrc.c:262:gst_file_src_set_location: uri : file:///C:/Users/Yumatov/Documents/build-testgstopencv-Desktop_Qt_5_12_2_MinGW_32_bit-Debug/%20videotestsrc%20!%20videoconvert%20!%20appsink0
0:00:00.115339921 416 00482000 WARN filesrc gstfilesrc.c:533:gst_file_src_start:<source> error: No such file "C:\Users\Yumatov\Documents\build-testgstopencv-Desktop_Qt_5_12_2_MinGW_32_bit-Debug\ videotestsrc ! videoconvert ! appsink0"
0:00:00.115367400 416 00482000 INFO GST_ERROR_SYSTEM gstelement.c:2141:gst_element_message_full_with_details:<source> posting message: Resource not found.
0:00:00.115391568 416 00482000 INFO GST_ERROR_SYSTEM gstelement.c:2168:gst_element_message_full_with_details:<source> posted error message: Resource not found.
0:00:00.115407460 416 00482000 WARN basesrc gstbasesrc.c:3469:gst_base_src_start:<source> error: Failed to start
因此,如果我正确理解,VideoCapture会认为我传递了文件名,但这不是事实。 因此,我该如何修复VideoCapture可以正确识别它的管道? 我的opencv版本4.1.0。