<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#CCCCCC" text="#000000">
    On 2/23/14 5:38 PM, Stanislav Smida wrote:<br>
    <blockquote
      cite="mid:4FB66C0C-8A66-4BED-AC47-AF43B5FD56CB@svagant.com"
      type="cite">
      <pre wrap="">Hi everyone,

I believe the problem will be trivial for experienced lib users, but I’m desperate (I’ve never used ffmpeg before). I have raw H.264 bitstream (NALUs as (const void *)bytes) and I need to determine which NALU is access unit (first NALU of the next frame). Can someone give me a hint how to do that?

In <libavcodec/h264.h> I’ve found `H264Context` struct and its fields like `got_first` and `ref_count[]` but I don’t have an idea how to initialize this context and flow particular NALUs through this context.

Thanks, best,
Stano

_______________________________________________
Libav-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a>
<a class="moz-txt-link-freetext" href="http://ffmpeg.org/mailman/listinfo/libav-user">http://ffmpeg.org/mailman/listinfo/libav-user</a>
</pre>
    </blockquote>
    <br>
    The answer depends on the bitstream that you have, but as far as I
    can tell, you likely have a bitstream that ships frames in one of
    two ways.  Those ways are outlined here:<br>
    <a class="moz-txt-link-freetext" href="http://en.wikipedia.org/wiki/Network_Abstraction_Layer#Access_Units">http://en.wikipedia.org/wiki/Network_Abstraction_Layer#Access_Units</a><br>
    This section and the section right after should help you figure out<br>
    <br>
    The second section might be a little obtuse at the moment, but what
    it describes is that (I think), if you find an IDR nalu, the decoder
    should be able to use the whole nalu for decoding one picture, and
    that subsequent i-frames will not refer to i-frames prior to the idr
    in front of them, as in (I think), one picture gets shipped as
    (idr)(non-idr)(non-idr)(non-idr)  ... (idr) <-this begins a new
    whole picture.  For one complete self-contained frame, you may
    obviously need the sps and pps.  So far, IDR, non IDR, and the units
    listed in the first section of the wiki link area all nalu types,
    refer to any google search for the values, or go download the spec.<br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Joshua Kordani
LSA Autonomy</pre>
  </body>
</html>