title: FFMPEG - Stream to RTMP output and save to MP4 at same time - with reconnect
body: <p>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. </p>
  
  <p>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. </p>
  
  <p>Which is great!</p>
  
  <p>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. </p>
  
  <p>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.</p>
  
  <p>I just have no idea how to achieve this!</p>
  
  <p>Has anybody got any ideas or tackled this before?</p>
  
  <p>Thanks,</p>
  
  <p>Matt</p>