Change stream source on-the-fly without interrupting HLS output #3419
Unanswered
vW7JKDTWMGwhRA
asked this question in
Questions
Replies: 2 comments
-
Something like this must be possible. When I use OBS I can change the source on the fly and the HLS stream I'm pumping to a website stays up and switches seamlessly. Hopefully someone will have an answer. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hello, in my opinion there are two ways to solve the issue:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Question
I'd like some guidance on how to configure either mediamtx or ffmpeg, to allow for changing the video source from a .mp4 video to capture card (live video) mediamtx path, without causing the mediamtx HLS output to not be interrupted.
Ex: source #1 = ffmpeg pre-roll-video.mp4 in a loop, then source #2 = ffmpeg live camera capture card, where the destination path for both is the same mediamtx '/stream'. The time for the change from pre-roll to the live camera is not predictable.
Currently, when i kill the "ffmpeg -re -i pre-roll -loop -f rtsp rtsp://host/stream" and start the replcaement ffmpeg -re -i 'capture card' -f rtsp rtps://host/stream" , the HLS output stream immediately terminates. The result is that users have to manually refresh their web-pages; which disables some automations & background actions.
I seen a reference to someone using 'HLS' .m3u8 file to define a sequence of videos for ffmpeg. I've also seen the '-concat' option for ffmpeg. But neither seem applicable for change ffmpeg from a file input to capture card (live) input.
BTW, I'm using MediaMtx for an internal network 'live' video distribution, the RTSP into HSL conversion is just wonderful. (Thank You for your time and commitment to this software.)
Beta Was this translation helpful? Give feedback.
All reactions