Domanda

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?

È stato utile?

Soluzione

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

Altri suggerimenti

Old question but useful. I answer on video.stackexchange: https://video.stackexchange.com/a/16933/12104

In short, you can loop input with filters, that can be combined to the next command:

ffmpeg -re -f lavfi -i "movie=filename=~/videofile.mp4:loop=0, setpts=N/(FRAME_RATE*TB)" http://192.168.2.38:8090/f.ffm

In this case there is not disconnects to the publish server (ffserver in your case).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top