title: how can I distinguish H264 encoded Video frames by some special tag?
body: <p>I have H264 encoded Video file came from Android mobile camera and I want to get the frames and store them as files one by one. The problem is, how can I distinguish the frames, do the frames split up by some special tag? Now I have this function which can get the frames length by bytes, maybe it helps to understand my questions,Thx:)</p>
  
  <pre><code>  public static int h263Parse(byte[]buf, int offset, int nLen)
  {
              int vop_found, i;          
      vop_found = 0;        
      i=0;
      if(vop_found == 0)
          {
          for(i=(offset + 3); i&lt;(offset+nLen); i++)
                  {
              if(buf[i-3] == 0x00)
                      if(buf[i-2] ==  0x00)
                              if((buf[i-1]&amp;0xff) &lt; 0x84)
                                      if((buf[i-1]&amp;0xff) &gt;= 0x80)
                          {
                  i++;
                  vop_found=1;
                  break;
              }
          }
      }
  
      if(vop_found == 1)
          {
          for(; i&lt;(offset+nLen); i++)
                  {
                  if(buf[i-3] == 0x00)
                      if(buf[i-2] ==  0x00)
                              if((buf[i-1]&amp;0xff) &lt; 0x84)
                                      if((buf[i-1]&amp;0xff) &gt;= 0x80)
                          {
                  return i-3-offset;
              }
          }
      }
      return -1;
  }
  </code></pre>