rtpjitterbuffer and percent property

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

rtpjitterbuffer and percent property

Daniel Mellado
Hi all!

First of all, thank for your time and knowledge.

I'm using a pipeline wichi has an rtspsrc element on it. Inside this element, two instances of rtpjitterbuffer are created. I set the buffering mode in the rtspsrc to Low/High Watermark buffering and then parse the buffering messages with parse_buffering() to have access to its percentage.

The buffer value goes up to 100% and then the video starts playing. I've tried a few things, like disconnecting the network, and I can understand that this value doesn't get updated until it buffers again. But if I ask directly the jitterbuffers using its percent property, they doesn't show any change at all. They get stuck at 100% even when they are just empty.

Is this a bug? Am I doing something wrong? Any clues regarding this will be greatly apretiated.


----Code sample----

self.player=gst.parse_launch(rtspsrc name=source ! decodebin2 ! autovideosink)
bus=self.player.get_bus()
bus.connect("message", self.on_message)
self.source=self.player.get_by_name('source')
self.source.connect("element-added",self.on_element_added)
self.buffer_percent=0
self.rtpjitterbuffer0=None
self.rtpjitterbuffer1=None

//Buffer mode for rtspsrc=2, latency=4000

def on_element_added(self, gstbin, element):
    //When rtpjitterbuffers are added to rtspsrc, points them to self.rtpjitterbuffers0 and 1

def on_message(self, bus, message)
    t=message.type
    if t == gst.MESSAGE_BUFFERING:
        self.buffer_percent=message.parse_buffering()

//I can also get buffer level info just using jitterbufferes internal percent property like that:

print self.rtpjitterbufferX.props.percent.


However, as I said, it fills up to 100%, but never changes, even if the playback stops due to network being stopped. ¿What am I doing wrong with this?

Many thanks.


Reply | Threaded
Open this post in threaded view
|

Re: rtpjitterbuffer and percent property

Daniel Mellado
Tried using a jitterbuffer not inside rtsprc but in the queue, and the behaviour it's the same. Even accessing the percent property or messages, They go from 0 to 100%, then suddenly drops to 16% (low threshold in gstrtpjitterbuffer).

¿How can I access the intermediate values?

Reply | Threaded
Open this post in threaded view
|

Re: rtpjitterbuffer and percent property

Daniel Mellado
I meant in the pipeline:

i.e rtspsrc buffer-mode=0 latency=0 ! gstrtpjitterbuffer mode=2 latency=4000 ! decodebin2 ! autovidesink

I get messages by parsing buffer level until 100% then video plays, but if the network it's down, and the buffer is used, I don't get any info from percentage goiing fro 100 to 16 percent, it just suddenly drops.

ie -> percent 100%
next message
-> percent 16%

Is there any way I can get that info? (values from percent property when playing from buffer)
ie.

Buffer 0%---messages 0.1...100% (Up to here it's ok)-->100%..messages from 100 to 16..16%.