Search code examples
ffmpegrtmpavi

How can ffmpeg stream a never-ending video file to RTMP


I currently have an issue publishing a constantly appended video file to RTMP. My workflow is

  • I proxy the MediaSource class in the browser.
  • From this I upload every byte appended to the buffers in a self hosted server
  • The server finally appends the video.avi file.

I want to stream that constantly updated avi file to an RTMP endpoint. The issue I encounter is that ffmpeg will stop streaming the file once it has reached the duration it had when launching ffmpeg.

I don't know much about streaming videos and if it can be done "just" by appending an avi file. The command I'm using is

.\ffmpeg.exe -re -i .\file.avi -c copy -f flv rtmp://localhost/live/STREAM_NAME

Thanks in advance for your help


Solution

  • It turns out that ffmpeg supports reading through FIFO. Now I'm creating a fifo instead of a regular file and just append my data in it.

    Thanks to @szatmary for the tip