title: How to add an arbitrary, formatted timestamp to a video with FFMPEG?
body: <p>I am calling ffmpeg from a custom tool to concatenate video files while overlaying a timestamp in the output.  The output video needs to have a timestamp starting at an arbitrary time.  The format must be a 12-hour clock with seconds and meridiem, <em>e.g.</em> 10:34:59 AM or 6:13:09 PM.  Here's the full command I'm using right now:</p>
  
  <pre><code>ffmpeg\bin\ffmpeg.exe -y -i "concat:input.mod" -ss 00:00:00 -t 00:02:17 
  -an -vcodec libx264 -profile:v baseline -level 13 -b:v 2000k -vf 
   "drawtext=fontcolor=white:fontsize=16:fontfile="/Windows/Fonts/arial.ttf":
  box=1:boxcolor=black@0.3:x=(w-text_w-10):y=(h-text_h-5):
  timecode='02\:36\:17\;00':rate=30000/1001" output.mp4
  </code></pre>
  
  <p>This outputs a 2 minute, 17 second duration video beginning at the start of the input file.  The output video has a timecode in the bottom-right corner beginning at the time 02:36:17 and ending at 02:38:34.  What I want is exactly this, but instead of printing "02:36:17;00" on frame 0 and counting up from there, it should print "2:36:17 AM" on frame 0 and count up from there.</p>
  
  <p>I have tried using the <code>localtime</code> function to output formatted time, but the time value it uses is the time that the <code>drawtext</code> filter is called.  It doesn't take a parameter for an arbitrary time.</p>
  
  <p>I have also looked at the <code>pts</code> function, which seems to allow an arbitrary offset but only supports two formatting options, neither of which is the clock format I need.</p>
  
  <p>What is the proper way to add a timestamp with an arbitrary starting time and format using ffmpeg?</p>