[gst-devel] rtp stats in python

Dirk Griffioen dirk.griffioen at barcelonamedia.org
Mon Oct 19 10:54:58 CEST 2009


Hi Florent,

Thanks a lot for the example! It works fine.

One small question, I tried to find the documentation - but could not 
locate it: in python for example the signal is 'get_stats', but the C 
example has 'stats'.

Where could I find this described/explained? For instance for other 
interesting statistics (like jitter, latency ...).

That would be another great piece of help!

Regards, Dirk


> Hi
>
>   
>> The RTP C examples in plugins-good show how to extract statistics.
>> I would like to do the same in Python, but I cannot find these functions
>> anywhere ...
>>     
>
> The following should work:
>
>
> import gst
>
> host="127.0.0.1"
> port=1234
> p = "videotestsrc ! rtpvrawpay ! udpsink host=%s port=%s" %(host, port)
>
> pipeline = gst.parse_launch(p)
> udpsink = pipeline.get_by_name("udpsink0")
>
> def print_stats():
>     data = udpsink.emit("get_stats", host, port)
>     stats = "bytes_sent: %s, packets_sent: %s, connect_time: %s"
> %(data[0], data[1], data[2])
>     print stats
>     return True
>
> import gobject
> gobject.timeout_add_seconds(1, print_stats)
>
> pipeline.set_state(gst.STATE_PLAYING)
>
> import gtk
> gtk.main()
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay 
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20091019/516f1ae1/attachment.htm>


More information about the gstreamer-devel mailing list