videostreamingvlcvideo-on-demand

VLC stream: Start video on connect


I am trying to run some experiments where I need to play a small video on one machine while it is being streamed from another server. I am able to stream it using the following command:

vlc -vvv big_buck_bunny_720p_30mb.mp4 --sout-keep --sout '#transcode{vcodec=theo,vb=800,acodec=vorb,ab=128,channels=2,samplerate=44100}:http{mux=ogg,dst=:8080/stream}'

But the video starts playing as soon as I give this command on the server, not when the client connects. Is there a way to start the video only when a client connects to the stream? There will be only one client.

I have read up the VLC streaming documentation but could not find any option to do this. Is there a programmable way? A hacky way is also acceptable.


Solution

  • I found a much easier way at this link. You just host a webserver, like Apache for my case, create a directory e.g. /var/www/html/videos/ and put the video in that directory. Now you can directly use the IP/Hostname of server to start a stream at the client side like this:

    vlc http://10.10.2.7/videos/video1.mp4
    

    Voila! Video on demand streaming, and it can support multiple clients as well.