title: Determining H264 GOP structure
body: <p>I have H264 encoded video packed in MOV container. And need to find out GOP structure <strong>M</strong> and <strong>N</strong> values as they defined here <a href="http://en.wikipedia.org/wiki/Group_of_pictures" rel="nofollow">http://en.wikipedia.org/wiki/Group_of_pictures</a>, i.e. <strong>M</strong> is the distance between two anchor frames (I or P) and <strong>N</strong> is the distance between I-frames. </p>
  
  <p>Is it possible to extract <strong>M</strong> and <strong>N</strong> from <strong>SPS</strong>/<strong>PPS</strong>? Or I have to read each frame of GOP and take frame type info from the slice header?</p>