4

Is it possible to make ffmpeg loop an input file infinite times copying its video and audio and streaming it to a RTMP server (nginx with rtmp module).

I am trying to create an animated video which repeats on the RTMP server for as long as the ffmpeg instance is running.

I have found the concat demuxer, but all examples I've found is using a playlist to concat the same video over and over into a single video. While I could create a stupidly long video that no sane user would watch in its entirety, it would consume a lot of disk space and wouldn't make sense to do in the least.

I could also add a while true bash loop to restart the process, but this may introduce delays or disconnects into the stream.

I am simply trying to find a way to take a single video and restream it once it ends without delays/interruptions in the stream.

Any help would be great.

Thanks.

1 Answers1

6

Try

ffmpeg -stream_loop -1 -i input {-rest of your parameters} -f flv rtmp://output
Gyan
  • 38,955