in nginx so that when the connection to the main stream is lost then the stream itself wouldnt cut off?
rtmp { server { listen 1935; application live { live on; exec ffmpeg -re -i rtmp://sourceurl -c copy -f flv rtmp://fallbackurl; } } } rtmp { server { listen 1935; application live { live on; exec ffmpeg -re -i rtmp://sourceurl -c copy -f flv rtmp://fallbackurl; wait_video on; wait_key on; timeout 10s; } } }
rtmp { server { listen 1935; chunk_size 4096; application live { live on; record off; # When a stream is published, start the FFmpeg fallback process exec_push ffmpeg -re -loop 1 -i /path/to/fallback.png -c:v libx264 -preset veryfast -g 30 -f flv rtmp://localhost/fallback/$name; # When the main stream is stopped, stop the FFmpeg fallback process exec_push_done killall -9 ffmpeg; } application fallback { live on; record off; } } }
actually coming back to that. doing it that way might not even be possible xd. but perhaps it can be done with hls and adding silent segment files to the playlist? but the thing is when using lossless audio it only works with fmp4 segment type, but it only creates one segment even when im using -hls_time 6 in ffmpeg. whats the deal with that?
Обсуждают сегодня