0

I use ffmpeg for rtmp streaming for instance with a command like this:

ffmpeg -i file.mp4 ... rtmp://localhost/stream

Sometime I need to replace file.mp4 with new_file.mp4. How do I do that without stutters and stopping the stream? I suppose I can't do sth like that:

mv new_file.mp4 file.mp4

without killing the ffmpeg process :)

1
  • 1
    Tell me please what solution did you find? – RTK Jul 11 '18 at 8:58
0

Put your ffmpeg inside an infinite loop:

#!/bin/bash
while true; do
  ffmpeg -i file.mp4 ... rtmp://localhost/stream
done
1
  • 1
    This does not work, the broadcast will restart every iteration – RTK Jul 11 '18 at 11:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.