mfvideosrc does not connect at startup, but ksvideosrc does
I have a Python application that connects to various cameras. I'm using pyqtgraph (PyQt5) for the GUI.
I'm also reading from an INI file that reads in the properties for the videosrc element. When I use ksvideosrc
, I can connect to the element and set it to playing with no problem. With mfvideosrc
, I have to select if from my dropdown list of available videosrc elements.
Since kvideosrc
is supposed to be deprecated, I'd like to get mfvideosrc
connected when I first start my program.
Thanks for any help.
INI file sections with the 2 videosrc elements:
[[[params]]]
name = ksvideosrc
blocksize = 4096
num-buffers = -1
typefind = False
do-timestamp = False
device-path =
device-name =
device-index = -1
do-stats = False
fps = -1
enable-quirks = True
[[[params]]]
name = mfvideosrc
blocksize = 4096
num-buffers = -1
typefind = False
do-timestamp = False
device-path =
device-name =
device-index = -1
I'd like to be able to connect to mfvideosrc after reading my INI file, without having to reselect it, as selecting from the dropdown list just get the default properties that I have to then change (like device-index
).
Trying to connect (out of the box):
0:00:07.416300000 184740 000002914FE9BB10 DEBUG mfvideosrc gstmfvideosrc.cpp:358:gst_mf_video_src_get_caps:<mfvideosrc> Returning caps video/x-raw, format=(string){ BGRx, BGRA, BGR, RGB15, RGB16, VUYA, YUY2, YVYU, UYVY, NV12, YV12, I420, P010, P016, v210, v216, GRAY16_LE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; image/jpeg, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:07.416782000 184740 000002914FE9BB10 DEBUG mfvideosrc gstmfvideosrc.cpp:358:gst_mf_video_src_get_caps:<mfvideosrc> Returning caps video/x-raw, format=(string){ BGRx, BGRA, BGR, RGB15, RGB16, VUYA, YUY2, YVYU, UYVY, NV12, YV12, I420, P010, P016, v210, v216, GRAY16_LE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; image/jpeg, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:07.420407000 184740 000002914FE9BB10 DEBUG mfvideosrc gstmfvideosrc.cpp:358:gst_mf_video_src_get_caps:<mfvideosrc> Returning caps video/x-raw, format=(string){ BGRx, BGRA, BGR, RGB15, RGB16, VUYA, YUY2, YVYU, UYVY, NV12, YV12, I420, P010, P016, v210, v216, GRAY16_LE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; image/jpeg, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:07.420892000 184740 000002914FE9BB10 DEBUG mfvideosrc gstmfvideosrc.cpp:358:gst_mf_video_src_get_caps:<mfvideosrc> Returning caps video/x-raw, format=(string){ BGRx, BGRA, BGR, RGB15, RGB16, VUYA, YUY2, YVYU, UYVY, NV12, YV12, I420, P010, P016, v210, v216, GRAY16_LE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; image/jpeg, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:07.425210000 184740 000002914FE9BB10 DEBUG mfvideosrc gstmfvideosrc.cpp:358:gst_mf_video_src_get_caps:<mfvideosrc> Returning caps video/x-raw, format=(string){ BGRx, BGRA, BGR, RGB15, RGB16, VUYA, YUY2, YVYU, UYVY, NV12, YV12, I420, P010, P016, v210, v216, GRAY16_LE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; image/jpeg, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:07.431198000 184740 000002914FE9BB10 DEBUG mfvideosrc gstmfvideosrc.cpp:358:gst_mf_video_src_get_caps:<mfvideosrc> Returning caps video/x-raw, format=(string){ BGRx, BGRA, BGR, RGB15, RGB16, VUYA, YUY2, YVYU, UYVY, NV12, YV12, I420, P010, P016, v210, v216, GRAY16_LE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; image/jpeg, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:07.431897000 184740 000002914FE9BB10 DEBUG mfvideosrc gstmfvideosrc.cpp:358:gst_mf_video_src_get_caps:<mfvideosrc> Returning caps video/x-raw, format=(string){ BGRx, BGRA, BGR, RGB15, RGB16, VUYA, YUY2, YVYU, UYVY, NV12, YV12, I420, P010, P016, v210, v216, GRAY16_LE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; image/jpeg, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
2023-07-01 20:23:53,610.610: (INFO) pipeline:open: mfvideosrc: Setting pipeline to playing state
0:00:07.446474000 184740 000002914FE9BB10 DEBUG mfvideosrc gstmfvideosrc.cpp:270:gst_mf_video_src_start:<mfvideosrc> Start
0:00:07.462567000 184740 000002914FE9BB10 ERROR mfvideosrc gstmfvideosrc.cpp:288:gst_mf_video_src_start:<mfvideosrc> Couldn't create capture object
2023-07-01 20:23:53,630.630: (ERROR) camera:open_camera: Camera 0: failed to connect to mfvideosrc
0:00:07.464518000 184740 000002914FE9BB10 DEBUG mfvideosrc gstmfvideosrc.cpp:270:gst_mf_video_src_start:<mfvideosrc> Start
0:00:07.466875000 184740 000002914FE9BB10 ERROR mfvideosrc gstmfvideosrc.cpp:288:gst_mf_video_src_start:<mfvideosrc> Couldn't create capture object
After selecting mfvideosrc
from dropdown menu - first select ksvideosrc
, then mfvideosrc
.:
** (python.exe:184740): WARNING **: 20:23:58.695: "ksvideosrc" is deprecated and will be removedin the future. Use "mfvideosrc" element instead
0:00:15.923171000 184740 000002914FE9BB10 DEBUG mfvideosrc gstmfvideosrc.cpp:358:gst_mf_video_src_get_caps:<mfvideosrc> Returning caps video/x-raw, format=(string){ BGRx, BGRA, BGR, RGB15, RGB16, VUYA, YUY2, YVYU, UYVY, NV12, YV12, I420, P010, P016, v210, v216, GRAY16_LE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; image/jpeg, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:15.923836000 184740 000002914FE9BB10 DEBUG mfvideosrc gstmfvideosrc.cpp:358:gst_mf_video_src_get_caps:<mfvideosrc> Returning caps video/x-raw, format=(string){ BGRx, BGRA, BGR, RGB15, RGB16, VUYA, YUY2, YVYU, UYVY, NV12, YV12, I420, P010, P016, v210, v216, GRAY16_LE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; image/jpeg, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:15.924526000 184740 000002914FE9BB10 DEBUG mfvideosrc gstmfvideosrc.cpp:358:gst_mf_video_src_get_caps:<mfvideosrc> Returning caps video/x-raw, format=(string){ BGRx, BGRA, BGR, RGB15, RGB16, VUYA, YUY2, YVYU, UYVY, NV12, YV12, I420, P010, P016, v210, v216, GRAY16_LE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; image/jpeg, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:15.924969000 184740 000002914FE9BB10 DEBUG mfvideosrc gstmfvideosrc.cpp:358:gst_mf_video_src_get_caps:<mfvideosrc> Returning caps video/x-raw, format=(string){ BGRx, BGRA, BGR, RGB15, RGB16, VUYA, YUY2, YVYU, UYVY, NV12, YV12, I420, P010, P016, v210, v216, GRAY16_LE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; image/jpeg, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:15.926285000 184740 000002914FE9BB10 DEBUG mfvideosrc gstmfvideosrc.cpp:358:gst_mf_video_src_get_caps:<mfvideosrc> Returning caps video/x-raw, format=(string){ BGRx, BGRA, BGR, RGB15, RGB16, VUYA, YUY2, YVYU, UYVY, NV12, YV12, I420, P010, P016, v210, v216, GRAY16_LE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; image/jpeg, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:15.926882000 184740 000002914FE9BB10 DEBUG mfvideosrc gstmfvideosrc.cpp:358:gst_mf_video_src_get_caps:<mfvideosrc> Returning caps video/x-raw, format=(string){ BGRx, BGRA, BGR, RGB15, RGB16, VUYA, YUY2, YVYU, UYVY, NV12, YV12, I420, P010, P016, v210, v216, GRAY16_LE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; image/jpeg, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
0:00:15.927327000 184740 000002914FE9BB10 DEBUG mfvideosrc gstmfvideosrc.cpp:358:gst_mf_video_src_get_caps:<mfvideosrc> Returning caps video/x-raw, format=(string){ BGRx, BGRA, BGR, RGB15, RGB16, VUYA, YUY2, YVYU, UYVY, NV12, YV12, I420, P010, P016, v210, v216, GRAY16_LE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; image/jpeg, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
2023-07-01 20:24:02,099.099: (INFO) pipeline:open: mfvideosrc: Setting pipeline to playing state
0:00:15.933589000 184740 000002914FE9BB10 DEBUG mfvideosrc gstmfvideosrc.cpp:270:gst_mf_video_src_start:<mfvideosrc> Start
0:00:16.291420000 184740 0000029159D022F0 DEBUG mfvideosrc gstmfvideosrc.cpp:358:gst_mf_video_src_get_caps:<mfvideosrc> Returning caps video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)1:4:0:1; video/x-raw, format=(string)NV12, width=(int)640, height=(int)480, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)1:4:0:1; video/x-raw, format=(string)NV12, width=(int)640, height=(int)360, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)1:4:0:1; video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)10/1, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)2:4:0:1, chroma-site=(string)dv; video/x-raw, format=(string)YUY2, width=(int)640, height=(int)480, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)2:4:0:1, chroma-site=(string)dv; video/x-raw, format=(string)YUY2, width=(int)640, height=(int)360, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)2:4:0:1, chroma-site=(string)dv; image/jpeg, width=(int)1280, height=(int)720, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)1:4:0:1; image/jpeg, width=(int)640, height=(int)480, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)1:4:0:1; image/jpeg, width=(int)640, height=(int)360, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)1:4:0:1
0:00:16.317432000 184740 0000029159D022F0 DEBUG mfvideosrc gstmfvideosrc.cpp:320:gst_mf_video_src_set_caps:<mfvideosrc> Set caps image/jpeg, width=(int)1280, height=(int)720, framerate=(fraction)30/1, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)1:4:0:1
0:00:16.678440000 184740 0000029159D022F0 DEBUG mfvideosrc gstmfvideosrc.cpp:509:gst_mf_video_src_create:<mfvideosrc> Updated latency value 0:00:00.006439700
2023-07-01 20:24:02,969.969: (INFO) camera:open_camera: Camera 0: connected to mfvideosrc
2023-07-01 20:24:03,092.092: (WARNING) pipeline:on_timer: capturesink: <flags GST_MESSAGE_LATENCY of type Gst.MessageType>: (no Gst.Structure)
2023-07-01 20:24:03,094.094: (WARNING) pipeline:on_timer: viewsink: <flags GST_MESSAGE_LATENCY of type Gst.MessageType>: (no Gst.Structure)
2023-07-01 20:24:03,097.097: (WARNING) pipeline:on_timer: capturesink: <flags GST_MESSAGE_LATENCY of type Gst.MessageType>: (no Gst.Structure)
2023-07-01 20:24:03,098.098: (WARNING) pipeline:on_timer: viewsink: <flags GST_MESSAGE_LATENCY of type Gst.MessageType>: (no Gst.Structure)
2023-07-01 20:24:03,100.100: (WARNING) pipeline:on_timer: viewsink: <flags GST_MESSAGE_LATENCY of type Gst.MessageType>: (no Gst.Structure)
2023-07-01 20:24:03,101.101: (WARNING) pipeline:on_timer: capturesink: <flags GST_MESSAGE_LATENCY of type Gst.MessageType>: (no Gst.Structure)
2023-07-01 20:24:06,458.458: (INFO) pipeline:close: mfvideosrc: Setting pipeline to null state
0:00:20.293125000 184740 000002914FE9BB10 DEBUG mfvideosrc gstmfvideosrc.cpp:302:gst_mf_video_src_stop:<mfvideosrc> Stop
2023-07-01 20:24:06,722.722: (INFO) camera:close_camera: Camera 0: disconnected