title: Programmatically concatenating MP4 or MOV files
body: <p>I have two MP4 files I need to concatenate and I need to do this programmatically - i.e. command line tools are not going to cut it. ffmpeg is not a possibility from a licensing point of view. </p>
  
  <p>For clarity, there is no preview, poster, edit or any other complexity. The MOVs are about the simplest they could be (H.264 encoded, video only - no audio, one TRAK per file).</p>
  
  <p>I believe that "all" I need to do is to :
  - concatenate the MDATs into a single block
  - update all elements of the STBL box/atom i.e. STSZ, STCO, etc. to reflect the new sample structure
  - propagate the new duration throughout MVHD, TKHD, MDHD atoms.</p>
  
  <p>In particular, I don't think I need to examine or process the internals of the MDAT atom at all.</p>
  
  <p>Is this correct or am I missing something ?</p>