gstreamer gst_parse_element_make: no element "video"
-
From the command line, the following pipeline works:
gst-launch-1.0 v4l2src device=/dev/video2 ! video/x-raw,width=720,height=576,framerate=25/1 ! autovideosink
But with QML Video or MediaPlayer:
player.source = "gstreamer-pipeline: v4l2src device=/dev/video2 ! video/x-raw,width=720,height=576,framerate=25/1"
gives
0:00:00.402697115 12711 0xaaaaf9d9ac30 ERROR GST_PIPELINE grammar.y:630:gst_parse_element_make: no element "video" -
Therefore am trying the following pipeline, to see if similar could then be used from Qt instead:
gst-launch-1.0 -vvv v4l2src device=/dev/video2 ! rawvideoparse width=720 height=576 format=yuy2 ! autovideosink
However that fails with
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to allocate required memory.
Setting pipeline to PAUSED ...
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
EGL: Warning: No default display support on wayland
EGL: Warning: No default display support on wayland
Pipeline is live and does not need PREROLL ...
/GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstKMSSink:autovideosink0-actual-sink-kms: display-width = 1280
/GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstKMSSink:autovideosink0-actual-sink-kms: display-height = 768
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw, format=(string)YUY2, width=(int)3840, height=(int)2160, framerate=(fraction)120/1, interlace-mode=(string)progressive, colorimetry=(string)1:4:5:1
/GstPipeline:pipeline0/GstRawVideoParse:rawvideoparse0.GstPad:sink: caps = video/x-raw, format=(string)YUY2, width=(int)3840, height=(int)2160, framerate=(fraction)120/1, interlace-mode=(string)progressive, colorimetry=(string)1:4:5:1
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to allocate required memory.
Additional debug info:
/usr/src/debug/gstreamer1.0-plugins-good/1.24.0.imx/sys/v4l2/gstv4l2src.c(955): gst_v4l2src_decide_allocation (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Buffer pool activation failed
Execution ended after 0:00:00.043197264
Setting pipeline to NULL ...
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
/usr/src/debug/gstreamer1.0/1.24.0.imx/libs/gst/base/gstbasesrc.c(3175): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
Freeing pipeline ... -
There is a capsfilter element that can be used explicitly with Qt/QML MediaPlayer:
player.source = "gstreamer-pipeline: v4l2src device=/dev/video2 ! capsfilter caps=video/x-raw,width=720,height=480,framerate=25/1"
That works sometimes, but segfaults other times:
1 format_cmp_func gstv4l2object.c 1276 0xffffd80668dc
2 g_slist_insert_sorted_real gslist.c 913 0xfffff604fab4
3 g_slist_insert_sorted gslist.c 964 0xfffff60504e0
4 gst_v4l2_object_fill_format_list gstv4l2object.c 1324 0xffffd8065a60
5 gst_v4l2_object_get_format_list gstv4l2object.c 1373 0xffffd8065f2c
6 gst_v4l2_object_probe_caps gstv4l2object.c 5212 0xffffd806ed34
7 gst_v4l2_object_get_caps gstv4l2object.c 5310 0xffffd806ef38
8 gst_base_src_default_query gstbasesrc.c 1373 0xffffd9219490
9 gst_pad_query gstpad.c 4228 0xffffd90ec24c
10 gst_pad_query_caps gstutils.c 3117 0xffffd913140c
11 gst_v4l2src_negotiate gstv4l2src.c 786 0xffffd8079a04
12 gst_base_src_negotiate_unlocked gstbasesrc.c 3490 0xffffd9213e9c
13 gst_base_src_loop gstbasesrc.c 2915 0xffffd9215e7c
14 gst_task_func gsttask.c 399 0xffffd9122090
15 g_thread_pool_thread_proxy gthreadpool.c 350 0xfffff605d780
16 g_thread_proxy gthread.c 831 0xfffff605cad8
17 start_thread pthread_create.c 447 0xfffff6730fc4
18 thread_start clone3.S 76 0xfffff67931cc -
@petero3 I guess you are using Qt5 and this feature of running pipelines within multimedia module is not supported any more in Qt6. Therefore, it may be a good idea to use raw gstreamer code directly and you have much better controls over your pipelines.