Using VLC to host a stream of an infinite video loop

checkThisOut picture checkThisOut · Sep 3, 2014 · Viewed 16.8k times · Source

I want to offer a video stream from my pc with a VLC player trough a WIFI network to smartphones for regression testing. The video should automatically restart at the beginning after being finished on the smartphone.

I'm currently using rtsp as protocol and the loop option, but this is no mandatory. The problem is, that every time the video restarts a new rtsp handshake is necessary. Since most of the smartphone apps I tested don't support reconnecting the stream automatically after being finished, I want to have only one handshake being valid all over the time.

vlc mypath\myvideo.mp4 sout=#transcode{vcodec=h264,acodec=none}:rtp{sdp=rtsp://:8554/} --loop

Thank you

Answer

EthanNAustin picture EthanNAustin · Mar 6, 2018

Thank you freeforall tousez!

The gather:std setting worked great for me. Below is my command line string for RTSP with a playlist.

cvlc --random --loop /var/www/html/files/test.xspf :sout=#gather:rtp{sdp=rtsp://:8554/} :network-caching=1500 :sout-all :sout-keep

This streams a playlist of videos randomly in a never ending loop. I hope this will help others.