title: How to get the slice-height and stride from a H264 stream?
body: <p>I need the <code>slice-height</code> and <code>stride</code> information in order to convert the YUV 4:2:0 Planar data to RGB.</p>
  
  <p>Is it inside the SPS/PPS? How do I calculate it?</p>
  
  <blockquote>
    <p>SPS = [0, 0, 0, 1, 103, 66, -32, 13, -90, -63, 65, -97, -97, 1, 66, 2,
    2, 3, -32, 0, 0, 125, 32, 0, 29, 76, 18, -128] </p>
    
    <p>PPS = [0, 0, 0, 1, 104,
    -50, 49, 18, 0, 0, 1, 6, 0, 1, -64, 6, 1, -124, 1, 1, 4, 4, 10, -75, 0, 49, 68, 84, 71, 49, 65, -8, -1, 83, 4, 64, 0, 2, 7, 93, 18, 0, 0,
    -94, 58, 0, 0, -94, 58, 0, 2, -102, 55, 0, 0, -100, -128, -128, 21, -128]</p>
  </blockquote>
  
  <p>The Android <code>MediaCodec</code> shows this information after a <code>MediaCodec.INFO_OUTPUT_FORMAT_CHANGED</code>:</p>
  
  <blockquote>
    <p>{image-data=java.nio.ByteArrayBuffer[position=0,limit=80,capacity=80],
    mime=video/raw, crop-top=0, crop-right=319, <strong>slice-height=192</strong>,
    color-format=21, height=192, width=320, what=1869968451,
    crop-bottom=179, crop-left=0, <strong>stride=384</strong>}</p>
  </blockquote>
  
  <p>How do I get this information directly from a H.264 stream? </p>