Bitrate of a stream
Nicolas Dufresne
nicolas at ndufresne.ca
Wed Dec 13 17:31:39 UTC 2017
Le mercredi 13 décembre 2017 à 04:27 -0700, SR.OR4CL3 a écrit :
> Hi, a need get a bitrate of a stream, i'm use the below code
>
> 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)
It's named "get-stats", I'm surprise it didn't abort.
> stats = "bytes_sent: %s, packets_sent: %s, connect_time: %s"
> %(data[0], data[1], data[2])
I don't think you can read a GstStructure like this.
> print stats
> return True
>
> import gobject
> gobject.timeout_add_seconds(1, print_stats)
>
> pipeline.set_state(gst.STATE_PLAYING)
>
> import gtk
> gtk.main()
>
> But, he don't give me a bitrate, someone could help me ? ?????
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20171213/89fa67ee/attachment-0001.sig>
More information about the gstreamer-devel
mailing list