Using VLC to host a stream of an infinite video loop

时光毁灭记忆、已成空白 提交于 2020-01-01 04:53:27

问题


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


回答1:


you need to use --sout-keep which keeps the stream output open (disabled by default)

and use gather:std and transcode option if the files use different encoding so that there wouldn't be any noticeable interruption on input change.

see:

1: https://wiki.videolan.org/Documentation:Streaming_HowTo/Command_Line_Examples/#Keeping_the_stream_open

2: https://wiki.videolan.org/Documentation:Modules/gather/




回答2:


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.



来源:https://stackoverflow.com/questions/25648337/using-vlc-to-host-a-stream-of-an-infinite-video-loop

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!