title: How can I Recording a UDP stream in segments, FFmpeg
body: <p>I'm looking for a way to record a UDP stream continuously in 30 minutes segments and encode live on the GPU. I want the recording to have the date and time burned into the clip and do it continuously (24/7).</p>
  
  <p>I have tried the following:</p>
  
  <pre><code>ffmpeg -i udp://source:port -c copy -flags +global_header -f segment -segment_time 1800 -segment_format_options movflags=+faststart -reset_timestamps 1 show_{Date}_{Time}.mp4
  </code></pre>
  
  <p><code>{Date}</code> and <code>{Time}</code> are variable holding the time of when FFmpeg starts. </p>
  
  <p>This records my segments correctly, however, if there is a loss in signal in the stream, it FFmpeg crashes and doesn't continue recording or start itself back up and this does not have the current time or date burned into the output video.</p>
  
  <p>I need it to be playable in html5, this is why I did mp4. </p>