Network buffer and live playback delay

This forum is about all development around libVLC.
maitrepiet
Blank Cone
Blank Cone
Posts: 69
Joined: 27 Oct 2009 14:44

Network buffer and live playback delay

Postby maitrepiet » 24 Aug 2014 15:00

Hi all,
I'm trying to achieve the following, but I'm afraid I'm making some wrong assumptions.

I have a video capture device that captures live video, I then transcode to mpeg2, TS, send it over the localhost, using udp.
Then I use a vlc player instance that connects to this udp stream.
I don't need to playback continuously, but only when something interesting happens. In that case, I start VLC playback by pressing play. After a few seconds I press stop. This is repeated over and over.
Most of the times, the delay between what is happening in real-time and the playback is constant (in my case about 2.15s). But sometimes it is only half of it.
I don't care too much about the exact value, but it has to be constant, because I'm overlaying some extra meta data, that needs to be synchronized with the video.

My assumption is that as soon as I connect vlc to the the udp stream, there is a buffer that is constantly buffering the incoming data. As soon as it is full, the oldest data is dropped, to make room for new data.
Second assumption is that this happens all the time, even if vlc is not actually showing the video.
Third assumption is that when I press play, playback always starts with the oldest buffered data.

Apparently there is something wrong in my assumptions.

Is there a better way of doing this?

Rémi Denis-Courmont
Developer
Developer
Posts: 15272
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Network buffer and live playback delay

Postby Rémi Denis-Courmont » 24 Aug 2014 15:18

VLC does not buffer when it is stopped.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

maitrepiet
Blank Cone
Blank Cone
Posts: 69
Joined: 27 Oct 2009 14:44

Re: Network buffer and live playback delay

Postby maitrepiet » 05 Sep 2014 21:10

OK,
and is the input buffer flushed when the player is stopped?
So, if I understand correctly, after I start the player, the buffer is filled and then playback starts?
Then why is the playback delay not constant? What should I do to have a constant delay?

Rémi Denis-Courmont
Developer
Developer
Posts: 15272
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Network buffer and live playback delay

Postby Rémi Denis-Courmont » 06 Sep 2014 17:21

The whole state is dropped on stop, not just the buffer.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 61 guests