Page 1 of 1

Network buffer and live playback delay

Posted: 24 Aug 2014 15:00
by maitrepiet
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?

Re: Network buffer and live playback delay

Posted: 24 Aug 2014 15:18
by Rémi Denis-Courmont
VLC does not buffer when it is stopped.

Re: Network buffer and live playback delay

Posted: 05 Sep 2014 21:10
by maitrepiet
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?

Re: Network buffer and live playback delay

Posted: 06 Sep 2014 17:21
by Rémi Denis-Courmont
The whole state is dropped on stop, not just the buffer.