Page 1 of 1
Detecting when UDP stream has stopped
Posted: 16 Apr 2007 21:00
by eccles42
Hi,
At the moment I can stream a movie UDP unicast from one place to another, however, if the source stops, I get the last frame of the video displayed until there's more data.
Is there any way of specifying "If you haven't had any data for 5secs, go to black screen/no screen" or something?
Cheers
Posted: 21 Apr 2007 15:55
by Rémi Denis-Courmont
The raw UDP streaming method has no way to specify this. So, this is essentially impossible.
It could be do-able with RTP, but it's not implemented
Posted: 21 Apr 2007 18:08
by eccles42
Hmmm, there should be a way to acheive the same result tho, even if it isn't in VLC.
I have an instance of VLC running all the time just listening to any UDP sent to it.
I can run a network monitor, either constantly or every 5 mins or so, that checks the network traffic, if there's no UDP, it runs VLC playing a small blank file to the other instance.
This should work as far as I can see, does anyone know of any suitable programs to do it?
Cheers
Posted: 22 Apr 2007 09:48
by Rémi Denis-Courmont
Well, you could concatenate a short silent audio-only stream right after the end of the actual stream on the sender side.
Re: Detecting when UDP stream has stopped
Posted: 21 Jun 2011 14:03
by adish
In fact, you can do it.
Use libvlc_event_attach to handle the libvlc_MediaPlayerTimeChanged event.
You will only get it if the stream is changing, so if you don't get it for, say, 1 second, it means something is wrong with the stream.
Good luck,
Adi