Page 1 of 1

how can I get current real-time buffer size in vlc streaming buffer?

Posted: 29 Jul 2018 14:05
by maozezhong
I want to get the current real-time buffer size while vlc streaming video, How can I get it through python-vlc. real-time buffer size means like, a video is stream from one server to one client, vlc get it and stored it in a buffer pool, and vlc decode the data in the pool so as to show the video currently, what I want is the size or time of video data in the pool during the streaming.

Re: how can I get current real-time buffer size in vlc streaming buffer?

Posted: 29 Jul 2018 15:26
by Jean-Baptiste Kempf
You cannot.

Re: how can I get current real-time buffer size in vlc streaming buffer?

Posted: 30 Jul 2018 03:24
by maozezhong
@Jean-Baptiste Kempf Hello, thanks for your reply, as far as I know, I can get MediaStats when playing a streamed video, like:

MediaStats
read_bytes: 7901716
input_bitrate: 2.51318240166*
demux_read_bytes: 7843817
demux_bitrate: 2.56340408325*
demux_corrupted: 0
demux_discontinuity: 2
decoded_video: 192
decoded_audio: 291
displayed_pictures: 65
lost_pictures: 0
played_abuffers: 145
lost_abuffers: 0
sent_packets: 0
sent_bytes: 0
send_bitrate: 0.0

So is it possible to get the buffer size through some calculation depends on these parameters?

Re: how can I get current real-time buffer size in vlc streaming buffer?

Posted: 30 Jul 2018 03:27
by maozezhong
Or, do you know where is the codes about buffer in vlc source code? https://github.com/videolan/vlc

Re: how can I get current real-time buffer size in vlc streaming buffer?

Posted: 30 Jul 2018 14:56
by Jean-Baptiste Kempf
Yes, but the buffer is not what you expect it is. Else, stats are available.

Re: how can I get current real-time buffer size in vlc streaming buffer?

Posted: 02 Aug 2018 14:50
by maozezhong
Can you kindly explain what the buffer exactly is ? And how can I get it?

Re: how can I get current real-time buffer size in vlc streaming buffer?

Posted: 01 Oct 2018 08:35
by oviano
Related to this - very roughly speaking how does libvlc buffer the input?

i.e. if I use the data callbacks in libvlc and throw TS packets at it, how much internal buffering of these does VLC do? I presume it needs to buffer a certain amount so it can identify what the stream is. But if it runs out of input packets (e.g. if they aren't provided quickly enough), does it increase the buffer? Or is buffering left entirely up to the calling application?

Re: how can I get current real-time buffer size in vlc streaming buffer?

Posted: 11 Dec 2018 03:06
by Hanks
i also have the same question. Do you figure it out now? where is the buffer in the code?