[FFmpeg-user] Switching input streams on an interval?

Stefan Kendall stefankendall at gmail.com
Thu Oct 15 04:00:12 CEST 2015

I have 1-5 input streams, each uploading on a slightly different time

With rtmp and ffmpeg, I can reliably encode a single stream into an HLS
playlist that plays seamlessly on iOS, my target delivery platform.

I know that you can accept multiple input streams into ffmpeg, and I want
to switch between the input streams to create a consistent, single,
seamless output.

So I want to switch between rtmp://localhost/live/stream1 ..
rtmp://localhost/live/stream5 on a regular interval. Sometimes there will
be multiple streams, and sometimes there won't.

Is there any way for ffmpeg to rotate between input streams while
generating an HLS playlist? My goal is to avoid running duplicate instances
of ffmpeg for server cost reasons, and I think connecting disparately
encoded input streams for playback would be difficult if not impossible.

Switching on each segment is the ideal behavior, but I also need to keep
the streams in time sync. Is this possible?

More information about the ffmpeg-user mailing list