12

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

checkThisOut
  • 621
  • 1
  • 5
  • 18

2 Answers2

10

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.

Eray Balkanli
  • 7,752
  • 11
  • 48
  • 82
EthanNAustin
  • 101
  • 1
  • 4
  • 1
    yep it helped me too – Salem May 15 '18 at 16:38
  • I'm trying to use this command in an HTTP source: cvlc --loop "http://192.168.1.51/cgi-bin/snapshot.cgi?d=1&q=0&chn=0&u=admin&p=test" :sout=#gather:rtp{sdp=rtsp://:8554/} :network-caching=1500 :sout-all :sout-keep ---- but then trying to read it, I see a bunch of "[rtsp @ 0xc291c0] Missed previous RTP Marker" and ffmpeg can't read the rtsp stream. Any ideas? – Hackeron Nov 10 '20 at 23:01
5

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/

freeforall tousez
  • 836
  • 10
  • 26
  • I'm trying to do that, but ffmpeg -I still detects end of file. my command is: cvlc --no-audio --loop --demux 'avformat' --avformat-format=mjpeg images-fifo --fps-fps 5 --mjpeg-fps 5 --sout-transcode-fps 5 --sout-keep --sout '#standard{access=http{mime="multipart/x-mixed-replace;boundary=7b3cc56e5f51db803f790dad720ed50a"},mux=mpjpeg,dst='":8084/video.mjpeg}" vlc://pause:10 ---- any ideas? – Hackeron Nov 13 '20 at 19:28