title: The Composition Time(CTS) when wrapping H.264 NALU's
body: <p>The h.264 hardware compression card procedures NALU's from captured video.</p>
  <p>I am trying to wrap the NALU's into FLV and I almost succeed.</p>
  <p>I don't know how to fill the Composition Time field in FLV for each NALU.</p>
  <p>According to the FLV spec, <a href="http://download.macromedia.com/f4v/video_file_format_spec_v10_1.pdf" rel="noreferrer">http://download.macromedia.com/f4v/video_file_format_spec_v10_1.pdf</a>, E.4.3.1.</p>
  <blockquote>
  <p><strong>CompositionTime</strong>  Composition time offset</p>
  <p>See ISO 14496-12, 8.15.3 for an explanation of composition  times. The
  offset in an FLV file is always in milliseconds</p>
  </blockquote>
  <p>Then look into the <a href="http://xcshen.blog.51cto.com/attachment/201104/2835389_1302074539.pdf" rel="noreferrer">ISO 14496-12,8.15.3</a> , Page 24 and 26</p>
  <blockquote>
  <p>provides the offset between decoding time and composition
  time. Since decoding time must be less  than the composition time, the
  offsets are expressed as unsigned numbers such that  <strong>CT(n) = DT(n) +</strong>
  <strong>CTTS(n) where CTTS(n)</strong> is the (uncompressed) table entry for sample n.</p>
  </blockquote>
  <p>How can I know the DT and CTTS in each NALU? or how to caculate the CT without DT and CTTS?</p>
  <p>Thank you</p>