Option to get a VLC client robust to intermittent HTTP media streaming server

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
theoneill
New Cone
New Cone
Posts: 4
Joined: 15 Apr 2018 20:02

Option to get a VLC client robust to intermittent HTTP media streaming server

Postby theoneill » 15 Apr 2018 20:42

Hi,

Here is my use case : I would like my windows PC to play an mp3 stream from a server which may be temporarily down. I would like the client to actually play the mp3 stream when the server is up, then if it is down, wait until it is up again and resume playback. Ideally, I would like this client to be discrete, without any interface or maybe juste sitting into the notification area. No popup in case the server is not reachable. This sounds quite simple but I haven't found what I was looking for so far.
Searching the forums, I tested with VLC using these options :

Code: Select all

vlc.exe http://my_server_IP:8000/mystream.mp3 --intf dummy --http-reconnect
It is doing exactly what I want if I disconnect the client from the network temporarily : When I put it back on the network, playback is resumed, everything is OK. But, if I try to do the same on the server side, if I try to restart the server for instance, here is what happens :
- If the disconnection is short enough (approx 1 min max), playback is resumed and everything is OK
- If the disconnection is longer, playback is not resumed, VLC is stuck on a ~15sec loop with mostly silence then a short slice of the buffer as it was when the server disconnected. It goes like this a couple of times, then the slice reduces again, etc... The client will never try to reconnect to the server.
I thought that this behaviour was linked to the fact that the server was broadcasting an endless stream, so I tried using --http-continuous with no luck, then with the help of other forums I tried the --loop option in case VLC was stuck at the end of the playlist but it did not help. In fact VLC seems to be stuck on this item. Once the server is back, I tried to wait +30min to see if VLC client tried to reconnect but it did not. If I start another instance, it works fine, playback is started in this new instance.

It looks as if after a certain "timeout", server unavailability was not detected by the VLC client which remains stuck trying to play the stream.

Do you think that my use case can be fulfilled by VLC of do I need to search for another tool? Is there something I missed into VLC configuration ?

I can provide log or anything that could be of help. I am running VLC 2.2.8 in Windows 10. The server is Icecast running on an Armbian Pi.

Thanks for your help.

Lionel

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

Re: Option to get a VLC client robust to intermittent HTTP media streaming server

Postby Rémi Denis-Courmont » 16 Apr 2018 16:13

The client cannot know if the stream is paused or dead if the server does not explicitly reset it. This looks like a server side issue.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

theoneill
New Cone
New Cone
Posts: 4
Joined: 15 Apr 2018 20:02

Re: Option to get a VLC client robust to intermittent HTTP media streaming server

Postby theoneill » 16 Apr 2018 19:29

Thanks for your feedback.
Yes in the use case I want to cover it is definitely a server side issue since I would like to client to cope with a transient loss of the server. So I wanted to know if VLC featured a specific function (that's what I expected from --http-reconnect but I probably misunderstood the aim of this parameter) to try to reconnect to the server periodically (let's say every minute for instance) to resume playback. As you say, in that case, the client must assume that the streaming is not paused but down and that a new connection will be required to recover.

Lionel

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

Re: Option to get a VLC client robust to intermittent HTTP media streaming server

Postby Rémi Denis-Courmont » 16 Apr 2018 19:34

--http-reconnect reconnects when the connection fails. Again, I don't really see how else the client could detect loss of server otherwise. Even with TCP keep-alives, recovery time would be several minutes.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

theoneill
New Cone
New Cone
Posts: 4
Joined: 15 Apr 2018 20:02

Re: Option to get a VLC client robust to intermittent HTTP media streaming server

Postby theoneill » 16 Apr 2018 20:01

I was thinking about something ugly like buffer@0% confirmed XXsec --> attempt to reconnect.
Lionel

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

Re: Option to get a VLC client robust to intermittent HTTP media streaming server

Postby Rémi Denis-Courmont » 16 Apr 2018 20:40

Again and again, as far as the client is concerned, if no data comes from HTTP, it means the stream is paused or the bit rate is extremely variable/low (subtitles, AJAX, etc).

So no.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

theoneill
New Cone
New Cone
Posts: 4
Joined: 15 Apr 2018 20:02

Re: Option to get a VLC client robust to intermittent HTTP media streaming server

Postby theoneill » 16 Apr 2018 23:27

OK that is clear. I perfectly understand that it must not be the default behaviour, since it is against the basic principles of networking and I haven't tried with all the client of the market but I am quite sure that they would behave the same way. I was asking before coding something specific if I could use some CL parameters to make VLC behave this wicked way and I have the answer now so thank you for this, and thanks for maintaining VLC.
Lionel


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 93 guests