Python 3, RTP, Udpsink, and Getting the Caps
Tim-Philipp Müller
t.i.m at zen.co.uk
Thu Jun 27 12:09:05 PDT 2013
On Thu, 2013-06-27 at 11:59 -0700, gstnewbiepants wrote:
Hi,
> I've searched through forums and used the Googler but I've had no luck...
> I'm trying to get the Caps from the Udpsink elements pad, but I want to do
> it pragmatically from within Python. I'm using GStreamer 1.0, Python 2.7,
> GTK+3, and PyGI. Right now the code looks like this:
>
> print self.udpsink.set_locked_state(Gst.State.PLAYING)
> print self.pipeline.set_state(Gst.State.PLAYING)
> pad = self.udpsink.get_static_pad('sink')
> print str(pad.get_property('caps'))
>
> When running this only "None" is printed from the last line.
The pipeline will go to playing state asynchronously, so by the time you
get the caps from the pad the format probably hasn't been negotiated
yet.
Wait for a state change message to PLAYING on the bus (with msg.src ==
pipeline) before querying, or do a self.get_state(5 * Gst.SECOND) or so
(not sure about the correct syntax).
Cheers
-Tim
> gst-launch-1.0 -v autovideosrc ! videoscale ! videoconvert !
> video/x-raw,format=\(string\)UYVY,width=\(int\)640,height=\(int\)480,framerate=\(fraction\)30/1
> ! videoscale ! videoconvert ! avenc_mpeg4 ! rtpmp4vpay ! udpsink
> host=127.0.0.1 port=5000 force-ipv4=true
>
> The pipeline actually works, but the video quality is horrible. I figure if
> I write the caps out to a file and have the client read it then things will
> be better. I do already have a jitter buffer with a latency of 100 ms on
> the client though.
>
> I just started using Gstreamer, and I will take any advice regarding
> anything at all.
>
> Thanks!
> Newb
>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Python-3-RTP-Udpsink-and-Getting-the-Caps-tp4660776.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
More information about the gstreamer-devel
mailing list