I'm trying to setup a pipeline where I can take an input and save to MP4 whilst at the same time streaming to an RTMP server.
So far I've been able to use a tee filter to achieve this and also using the onfail=ignore to make sure the pipeline stays up in the event of the RTMP/Recording failing.
Which is great!
However, I don't want the RTMP to just give up if it were to drop or be disconnected, I'd like it to keep attempting to reconnect and resume the stream.
I don't think FFMPEG has something like this, so I'd need to write it in a bash script or something that keeps restarting the process in the event of a drop.
I just have no idea how to achieve this!
Has anybody got any ideas or tackled this before?
Thanks,
Matt
Use fifo format, which can reconnect.
My working example:
-f fifo -fifo_format flv \
-drop_pkts_on_overflow 1 -attempt_recovery 1 -recover_any_error 1 \
rtmp://bla.bla/bla
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With