Network buffer and live playback delay
Posted: 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?
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?