title: ffmpeg capture RTSP stream to hourly file
body: <p>I'm using ffmpeg to capture a RTSP stream to a file using the following command:</p>
  
  <pre><code>ffmpeg -i rtsp://[IP Address]:[port]/[URL] -vcodec copy -r 60 -t 2600 -y /[outputfile].mp4
  </code></pre>
  
  <p>This works ok and captures 60 mins fine. What I'd like to be able to do is:</p>
  
  <ol>
  <li>Output hourly files, e.g. <code>capture1.mp4 capture2.mp4</code> etc.</li>
  <li>Put the current timestamp as the overlay in the current file (currently
  VLC says something like <code>LIVE555...</code>). I'd like to change this to
  <code>source + timestamp</code>. </li>
  <li>Delete old mp4 files over x days old, e.g. keep files for 1 or 2 days</li>
  </ol>
  
  <p>Is this possible in ffmpeg or do i need to put a script wrapper around the ffmpeg command? If so, any examples of those I can re-use please?
  This is on Ubuntu linux using latest ffmpeg package and using <code>apt-get install ffmpeg</code> to install so it's built from source.</p>
  
  <p>Thanks</p>