[FFmpeg-user] Replacing stream input when using segment time option

James Fowkes jamesfowkes at gmail.com
Wed Oct 14 12:02:10 EEST 2020


Hello all,

We have an application using ffmpeg to record an RTSP stream. We split this
stream into timestamped segments using the following options:

ffmpeg -f segment -segment_time 60 -strftime 1 "+%Y-%m-%d_%H-%M-%S.mp4"

We now have a requirement to replace recordings made using this stream with
a placeholder blank video under certain conditions (for privacy reasons).
This needs to be recorded using the same segment time options so that later
post- processing can treat the files the same and not have to know which is
"real" video and which is placeholder. The switchover does not have to be
seamless, it's OK to stop one ffmpeg process and start another.

I'm comfortable with ffmpeg basics, but this is a bit beyond my knowledge.
I'm not sure of the best way to do things.

Is the easiest way to have one instance of ffmpeg acting as a streaming
server for the placeholder video (using -stream_loop maybe?) and then
switch to recording from this stream when required? Or am I overthinking
this?

Thanks,


More information about the ffmpeg-user mailing list