title: Create MDAT from I-frame/P-frame fragments
body: <p>I am creating an MPEG-4 file from H.264 stream. H.264 stream comes in NAL format (EG: 0,0,0,1,67,...,0,0,1,68,...).
  Each video frame is transmitted as multiple I-frame/P-frame fragments. For eg: Frame 1 contains approximately 80 I-frame fragments and Frame 2 contains around 10 P-frame fragments.</p>
  
  <p>I understand that MDAT atom of the MPEG-4 file is supposed to contain H.264 streams in NAL format.</p>
  
  <p>I would like to know how these fragments can be converted to a single I-frame before I can put it into MDAT atom of MPEG-4.</p>
  
  <p>I do not want to use any libraries.</p>
  
  <p>Thanks for your help.</p>