Search code examples
nginxffmpegrtmpm3u8

Combine two input audio/video in Nginx RTMP


I'm trying to do a Web TV for my Radio but i'm stucked into this problem.

I'm trying to put a video loop (mp4) and trying to add into that loop the audio source of my radio who stream in m3u8 via Shoutcast.

Is possible to do this? I try to search everything on internet without any particular result.


Solution

  • Use -stream_loop:

    ffmpeg -re -stream_loop -1 -i input.mp4 -i rtmp:// -map 0:v -map 1:a output
    

    -re will play input.mp4 at realtime for streaming instead of as fast as possible.

    Make sure you use FFmpeg 4.0 or newer or it will not work.