Get Element from Pipeline - PyGI and Gstreamer 1.0

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

Get Element from Pipeline - PyGI and Gstreamer 1.0

gstnewbiepants
This post was updated on .
Hey Guys,

I've made a pipeline with this command:

self.pipeline = Gst.parse_launch("rtpbin name=rtpbin v4l2src ! videoscale ! videoconvert ! video/x-raw,format=UYVY,width=640,height=480,framerate=30/1 ! videoscale ! videoconvert ! avenc_mpeg4 bitrate=1 ! rtpmp4vpay ! rtpbin.send_rtp_sink_0 rtpbin.send_rtp_src_0 ! udpsink name=udpsink_video port=5002 host=" + ip_address + " rtpbin.send_rtcp_src_0 ! udpsink port=5003 host=" + ip_address + " sync=false async=false udpsrc port=5007 ! rtpbin.recv_rtcp_sink_0")

Now though, I need to get the Caps from the Udpsink named "udpsink_video".  

In a previous post here:
http://gstreamer-devel.966125.n4.nabble.com/Python-3-RTP-Udpsink-and-Getting-the-Caps-tp4660776.html

I realized I needed a delay between playing the pipeline or getting the Caps.  But now I've changed the way I've constructed the pipeline, as I'm not using parse_launch.  

So, how can I go about getting the udpsink_video element and then getting it's caps after waiting for about three seconds for the pipeline to start?

Thanks,
Newb

PS:  Does anyone know if there is more complete documentation on Gstreamer 1.0 with Python than can be found here?
https://wiki.ubuntu.com/Novacut/GStreamer1.0

Reply | Threaded
Open this post in threaded view
|

Re: Get Element from Pipeline - PyGI and Gstreamer 1.0

gstnewbiepants
Nevermind, figured it out!

source = self.pipeline.get_by_name("udpsink_video")
pad = source.get_static_pad('sink')
print pad.get_property('caps').to_string()

Thanks!