v4l2src -> qmlglsink not possible / transform problem

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

v4l2src -> qmlglsink not possible / transform problem

realBohd2
Hi all,
 
I'm trying to pipeline a webcam to a qmlglsink.
 
When testing:
gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! autovideosink
This is working.
 
FYI: my webcam seems to provide YUY2 (only).
 
But when testing (in Code):
v4l2src device=/dev/video0 ! videoconvert ! glupload ! qmlglsink
I get this problem:
gluploadelement0> transform could not transform 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:5:1, interlace-mode=(string)progressive in anything we support
 
I can reproduce this behaviour in commandline with:
gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! glupload ! gldownload ! autovideosink --gst-debug-level=4
 
Same problem:
WARN           basetransform gstbasetransform.c:1364:gst_base_transform_setcaps:<gluploadelement0> transform could not transform 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:5:1, interlace-mode=(string)progressive in anything we support
INFO                 basesrc gstbasesrc.c:2962:gst_base_src_loop:<v4l2src0> marking pending DISCONT
WARN           basetransform gstbasetransform.c:1364:gst_base_transform_setcaps:<gluploadelement0> transform could not transform 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:5:1, interlace-mode=(string)progressive in anything we support
WARN                 basesrc gstbasesrc.c:3072:gst_base_src_loop:<v4l2src0> error: Internal data stream error.
WARN                 basesrc gstbasesrc.c:3072:gst_base_src_loop:<v4l2src0> error: streaming stopped, reason not-negotiated (-4)
INFO        GST_ERROR_SYSTEM gstelement.c:2141:gst_element_message_full_with_details:<v4l2src0> posting message: Internal data stream error.
INFO        GST_ERROR_SYSTEM gstelement.c:2168:gst_element_message_full_with_details:<v4l2src0> posted error message: Internal data stream error.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
 
I also tried something like:
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw, width=320, height=240, format=YUY2 ! videoconvert ! "video/x-raw, width=320, height=240, format=RGBA" ! glupload ! gldownload ! autovideosink --gst-debug-level=4
 
For my understanding the videoconvert should be able to handle YUY2 as well as the RGBA that is expected by glupload. But something is missing..
 
Any enlightment into this is highly appreciated,
 
Thanks + Best,
Bodo

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: v4l2src -> qmlglsink not possible / transform problem

Nicolas Dufresne-5


Le mer. 19 juin 2019 03 h 25, Bodo Pfeifer <[hidden email]> a écrit :
Hi all,
 
I'm trying to pipeline a webcam to a qmlglsink.
 
When testing:
gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! autovideosink
This is working.
 
FYI: my webcam seems to provide YUY2 (only).
 
But when testing (in Code):
v4l2src device=/dev/video0 ! videoconvert ! glupload ! qmlglsink
I get this problem:
gluploadelement0> transform could not transform 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:5:1, interlace-mode=(string)progressive in anything we support

Not sure why yuy2 is accepted downstream of videoconvert, but it's likely a good idea to add a glcolorconvert element in your pipeline. Normally we wrap qmlglsink into glsinkbin to ensure there is a proper GL accelerated display pipeline setup.

 
I can reproduce this behaviour in commandline with:
gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! glupload ! gldownload ! autovideosink --gst-debug-level=4
 
Same problem:
WARN           basetransform gstbasetransform.c:1364:gst_base_transform_setcaps:<gluploadelement0> transform could not transform 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:5:1, interlace-mode=(string)progressive in anything we support
INFO                 basesrc gstbasesrc.c:2962:gst_base_src_loop:<v4l2src0> marking pending DISCONT
WARN           basetransform gstbasetransform.c:1364:gst_base_transform_setcaps:<gluploadelement0> transform could not transform 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:5:1, interlace-mode=(string)progressive in anything we support
WARN                 basesrc gstbasesrc.c:3072:gst_base_src_loop:<v4l2src0> error: Internal data stream error.
WARN                 basesrc gstbasesrc.c:3072:gst_base_src_loop:<v4l2src0> error: streaming stopped, reason not-negotiated (-4)
INFO        GST_ERROR_SYSTEM gstelement.c:2141:gst_element_message_full_with_details:<v4l2src0> posting message: Internal data stream error.
INFO        GST_ERROR_SYSTEM gstelement.c:2168:gst_element_message_full_with_details:<v4l2src0> posted error message: Internal data stream error.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
 
I also tried something like:
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw, width=320, height=240, format=YUY2 ! videoconvert ! "video/x-raw, width=320, height=240, format=RGBA" ! glupload ! gldownload ! autovideosink --gst-debug-level=4
 
For my understanding the videoconvert should be able to handle YUY2 as well as the RGBA that is expected by glupload. But something is missing..
 
Any enlightment into this is highly appreciated,
 
Thanks + Best,
Bodo
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: v4l2src -> qmlglsink not possible / transform problem

realBohd2
Nicolas Dufresne-5 wrote
> Not sure why yuy2 is accepted downstream of videoconvert, but it's likely
> a
> good idea to add a glcolorconvert element in your pipeline. Normally we
> wrap qmlglsink into glsinkbin to ensure there is a proper GL accelerated
> display pipeline setup.

Thanks for your answer.

I tried the glsinkbin in the terminal and got something running:
/gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! glupload !
glsinkbin sink=glimagesink/

But when doing this in code with a qmlglview, it somehow does nothing. The
previous error is gone, but I can't see something.
Also the LED on the webcam isn't active which is a sign of something isn't
running properly.

The code:

/pipeline = gst_pipeline_new (nullptr);

GstElement *src = gst_element_factory_make ("v4l2src", NULL);
g_object_set(src, "device", "/dev/video0", NULL);

GstElement *conv = gst_element_factory_make ("videoconvert", nullptr);
GstElement *glupload= gst_element_factory_make ("glupload", nullptr);

sinkQml = gst_element_factory_make ("qmlglsink", nullptr);
sinkBin = gst_element_factory_make("glsinkbin", nullptr);

g_object_set (sinkBin, "sink", sinkQml, nullptr);

gst_bin_add_many (GST_BIN (pipeline), src, conv, glupload, sinkBin,
nullptr);
gst_element_link_many (src, conv, glupload, sinkBin, nullptr);/

Something that is different from the terminal version is that I'm in need of
an qmlglsink element to attach the videoItem widget to. This is done after
this code section. The qmlsink it self is not added to the pipeline or
linked explicitly. Not sure if this is the correct handling.

From a first crawling through the gst debug output (level debug) I can't
find any obvious errors or problems. It seems like everything is setup and
deconstructed afterwards.

And from what is shown there is seems some glcolorconvert is involved
automatically (maybe handled / created by the glsinkbin?)

Thanks + Best,
Bodo



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: v4l2src -> qmlglsink not possible / transform problem

realBohd2
Hi,

ok, got it to work now :)

Due to all the testing and commenting in the code, I also had the attachment
of the widget commented out... This explains the build + deconstruct
behaviour..

Thanks for the hint with the glsinkbin!

Best,
Bodo



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: v4l2src -> qmlglsink not possible / transform problem

Nicolas Dufresne-5
Le jeudi 20 juin 2019 à 04:47 -0500, realBohd2 a écrit :
> Hi,
>
> ok, got it to work now :)
>
> Due to all the testing and commenting in the code, I also had the attachment
> of the widget commented out... This explains the build + deconstruct
> behaviour..
>
> Thanks for the hint with the glsinkbin!

Great! By the way, you can remove the spurious glupload element, it is
contained into glsinkbin already.

>
> Best,
> Bodo
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (201 bytes) Download Attachment