VLC streaming with ip camera - reconnect when camera resets

I am using VLC to get the video stream from my ip cam and stream it to the network, in order to save the limited wifi band that reaches the cam. The command I use to do this is as follows:

cvlc [cam stream] --sout "#standard{access=http{mime=multipart/x-mixed-replace;boundary=--7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:[chosen port]}"

The problem is that when the camera restarts neither VLC quits nor it reconnects to it, so I cannot run it again. Does anyone have an idea on how to sove this? Any help will be very appreciated.

Answers


Got it working by writing a script that periodically connects to the vlc instance via TELNET, checks the ammount of bytes received and saves it into a log file. In case the ammount of bytes is equal to the last time it checked, it sends a stop then a play command to VLC and, if the camera is back online it will work again. If anyone wants more details about the implementation, just ask!


Need Your Help

Is it good to add min-width, max-width, min-height, max-height always in any type of layout fixed or liquid?

html css xhtml cross-browser

Is it good to add min-width, max-width, min-height, max-height always in any type of layout fixed or liquid?