Change appsrc's caps while playing

omer.tal jacklawi at gmail.com
Mon Dec 14 08:57:05 UTC 2020


Hey,

So I have an app which streams images from some source. The images width and
height of the images may change from frame to frame.
I wish my pipeline to allow any frame size to be sent to the pipeline, and
have a videoscale element to be in charge of the resizing.

How can I change the width and height caps of the appsrc while it is
playing?

I tried to simply modify the caps using the following code when loading a
new image and it didn't work...

    g_object_set (G_OBJECT (m_data.app_src), "caps",
          gst_caps_new_simple ("video/x-raw",
                       "format", G_TYPE_STRING, "RGB",
                       "width", G_TYPE_INT, image.width(),
                       "height", G_TYPE_INT, image.height(),
                       "framerate", GST_TYPE_FRACTION, 30, 1,
                       NULL), NULL);


Any ideas?
BTW if there's a good place to learn more about appsrc, I would love  a
link. The "Short-cutting the pipeline" tutorial is really basic stuff.


Thank you.



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list