Print out caps of an element

m.lenz m.lenz at kappa-optronics.com
Thu Jan 16 14:31:19 UTC 2020


In a new application I grab video data with appsrc from a sensor and then
start streaming this RAW-Video data to my loopback address via an
udpsink-element. So I can grab it from there anytime and do other things I
want to do with it.

Now I simply want to grab the data from command line by this pipeline:
gst-launch-1.0 -v udpsrc address=127.0.0.1 port=5000 caps =
"application/x-rtp, media=(string)video, payload=(int)96,
clock-rate=(int)90000, encoding-name=(string)RAW, format=(string)I420,
depth=(string)8, width =(int)640, height=(int)480, framerate=(fraction)30/1"
! rtpvrawdepay ! rawvideoparse ! queue ! xvimagesink

This gives me an 'Internal data stream error' of udpsrc0. So there might be
something wrong with the caps.

In the application I use these caps for appsrc: ("video/x-raw", "format",
G_TYPE_STRING, "I420", "width", G_TYPE_INT, 640, "height", G_TYPE_INT, 480,
"framerate", GST_TYPE_FRACTION, 30, 1, NULL)

I have found out that I have to figure out the caps of my sink pad, but I
don't really know how. I have my 'GstElement *videosink;' and 'videosink =
gst_element_factory_make ("udpsink", "videosink");'

I can print out caps in such a way:
gchar *capsstr; 
capsstr = gst_caps_to_string (GST_PAD_CAPS (pad))) 
g_print ("caps: %s\n", capsstr); 
g_free (capsstr);

But how do I get the pad of my udpsink?





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


More information about the gstreamer-devel mailing list