Search code examples
ffmpegffserver

Loop playback with ffmpeg + ffserver


I have ffserver that multicast some stream to other devices and ffmpeg that send some input video to ffserver using following command:

ffmpeg -re -y -i ~/videofile.mp4 http://192.168.2.38:8090/f.ffm

Is it possible to loop video playback, I mean that after videofile.mp4 ends, ffmpeg or ffserver restarts playback from the beggining of the file?


Solution

  • I couldn't find a key for ffmpeg to loop playback, but it can be easily done using shell script:

    #!/bin/sh
    
    while [ 1 ] ; do
      ffmpeg -re -y -i /path_to_videofile http://url:8090/f.ffm
    done