Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gstreamer: Why do I need a videoconvert before displaying some filter?

Tags:

gstreamer

I am writing a very basic pipeline on GStreamer 1.0 and I would like to understand why I need a videoconvert before displaying the stream.

gst-launch-1.0 videotestsrc ! vertigotv ! videoconvert ! autovideosink

If I remove the videoconvert from the pipeline then I get an error and the stream does not play:

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2933): gst_base_src_loop (): /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0:
streaming task paused, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

I don't get why the caps can't be automatically negotiated.

Here are the capabilities template of the sink pad of vertigo:

Capabilities:
  video/x-raw
             format: { RGBx, BGRx }
              width: [ 1, 2147483647 ]
             height: [ 1, 2147483647 ]
          framerate: [ 0/1, 2147483647/1 ]

Here is the capabilities template of the src pad of autovideosink:

Capabilities:
  ANY

Can someone explain me why this element is necessary to play the pipeline. Why do I need to switch colorspace before displaying the pipeline? Is there a way not to use this element (maybe using caps)?

like image 425
MarAja Avatar asked Nov 09 '15 15:11

MarAja


People also ask

What does Videoconvert do in GStreamer?

* Convert video frames between a great variety of video formats. * automatically convert the video to a format understood by the video sink.

Is GStreamer multithreaded?

A normal GStreamer pipeline can easily have dozens of threads interacting with each other.

What is latency in GStreamer?

Latency is the term used to describe how long it takes for video from the source side to get to the sink side. For example, if a video system was described as having a latency of 1 second, that would mean that it takes 1 second for the video to get from the capture (or reading a file) side to the actual display.

How do I stop GStreamer pipeline in Python?

Ctrl-C will not exit the program, only Ctrl-\ will force it to quit. Hi, Is the issue observed in running gst-launch-1.0?


1 Answers

vertigotv element can only handle raw video frames in RGBx and BGRx formats. autovideosink can not guarantee support of RGBx / BGRx format. You need videoconvert element to ensure compatibility between vertigotv's source and autovideosink's sink pads.

autovideosink is a bin, which contains actual video sink inside. autovideosink's sink pad capabilities are determined by capabilities of sink pad of it's internal video sink. Pipeline graph with autovideosink which uses glimagesink, without videoconvert

It can use several types of video sink. glimagesink, for example, will work without videoconvert (as it can read RGBx / BGRx frames). osxvideosink, on other hand, will not work without videoconvert (because of lack support for RGBx / BGRx).

In case autovideosink will use video sink with RGBx / BGRx support, videoconvert element will just pass frames through, without performing any job. So, you can safely leave it for all the cases.

like image 133
Kyrylo Polezhaiev Avatar answered Oct 27 '22 04:10

Kyrylo Polezhaiev