title: Need to convert h264 stream from annex-b format to AVCC format
body: <p>I need to convert h264 stream from annex-b format to AVCC format.</p>
  
  <p>I tried this to convert from h264  annex-b to AVCC:
  I extracted the SPS and PPS from the annex stream and created the Extra data.
  I then looked in the stream for 0x00 0x00 0x00 0x01 (which should be the start of each Nal) and continue looking for another 0x00 0x00 0x00 0x01 (which will be the end of the Nal) then did minus to get the Nal length, then replace the first 0x00 0x00 0x00 0x01 to 0x00 0x00 0x00 [NulSize] but seems that this does not produce valid stream.
  I then found out that NUL can starts/ends with 0x00 0x00 0x01 so i am little confused.</p>
  
  <p>anyway, I hope someone will be able to write me function that convert from annex-b to AVCC.</p>
  
  <p>Thanks.</p>