By the way, you can find the stream header in AVCodecContext::extradata after avformat_find_stream_info() call.<br><br><div class="gmail_quote">2013/6/14 Sergey Fedorov <span dir="ltr"><<a href="mailto:night.rain.whisper@gmail.com" target="_blank">night.rain.whisper@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd757808%28v=vs.85%29.aspx" target="_blank">H.264 Video Types</a>: <br>
</div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">
<div dir="ltr">The MP4 container format stores H.264 data without start codes. Instead,
 each NALU is prefixed by a length field, which gives the length of the 
NALU in bytes. The size of the length field can vary, but is typically 
1, 2, or 4 bytes.</div></blockquote><div><br>See also: <a href="http://aviadr1.blogspot.ru/2010/05/h264-extradata-partially-explained-for.html" target="_blank">H.264 extradata (partially) explained - for dummies</a> </div>
<div class="HOEnZb"><div class="h5"><div class="gmail_extra">
<br><br><div class="gmail_quote">2013/6/13 Anshul maheshwari <span dir="ltr"><<a href="mailto:er.anshul.maheshwari@gmail.com" target="_blank">er.anshul.maheshwari@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p>U can try using gdb,  put a brk point on above line u provided,<br>
Print the pkt, <br>
If trouble using gdb,  reply me I wud do fr u!<br>
It was never required to me!</p>
<p>Anshul</p>
<div class="gmail_quote"><div><div>On Jun 13, 2013 10:16 PM, "Arvind Raman" <<a href="mailto:arvind_raman@yahoo.com" target="_blank">arvind_raman@yahoo.com</a>> wrote:<br type="attribution"></div>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>
<div><div style="font-size:10pt;font-family:Courier New,courier,monaco,monospace,sans-serif"><div style="font-family:'Courier New',courier,monaco,monospace,sans-serif;font-size:10pt"><span style="font-weight:bold;text-decoration:underline">Question</span> - What is the format in which audio / video ES data is stored in (<span>AVPacket</span>*) pkt->data? I am trying to <span>demux</span> and decode AV data from a MP4 file using <span>libavformat</span> and <span>libavcodec</span>.</div>



<div style="font-family:'Courier New',courier,monaco,monospace,sans-serif;font-size:10pt"><br></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:'Courier New',courier,monaco,monospace,sans-serif">



<span style="font-weight:bold;text-decoration:underline">More details</span></div><ol><li><span style="font-family:'Courier New',courier,monaco,monospace,sans-serif;font-size:13px;background-color:transparent">Using the sample application <span>demuxing</span>.c (</span><a href="http://www.ffmpeg.org/doxygen/trunk/demuxing_8c_source.html" style="font-family:'Courier New',courier,monaco,monospace,sans-serif;font-size:13px;background-color:transparent" target="_blank">http://www.ffmpeg.org/doxygen/trunk/demuxing_8c_source.html</a><span style="font-family:'Courier New',courier,monaco,monospace,sans-serif;font-size:13px;background-color:transparent">) I tried <span>demuxing</span> and decoding a MP4 file containing H.264 video and <span>AAC</span> audio. </span></li>



<li><span style="font-family:'Courier New',courier,monaco,monospace,sans-serif;font-size:13px;background-color:transparent">While the sample application worked fine, I wasn't able to interpret the content in the pkt.data buffer (line #66 in the above file). Since the video was H.264 I was hoping to see familiar "<span>nal</span>_unit_type" but I don't think I saw that for the stream I was trying to decode. If I remember the data correctly the first 4 bytes in the pkt.data buffer were "0x00 0x00 0x02 0x72"</span></li>



</ol><div><span style="background-color:transparent;font-family:'Courier New',courier,monaco,monospace,sans-serif;font-size:13px">I haven't spent much time figuring this out yet but searching on the Internet / forum didn't help. I intend to dig deeper tomorrow, but just wanted to check if indeed ES was being passed in the pkt.data buffers in a special way.</span></div>



<div style="font-style:normal;font-size:13px;background-color:transparent;font-family:'Courier New',courier,monaco,monospace,sans-serif"><span style="font-family:'Courier New',courier,monaco,monospace,sans-serif;font-size:13px"><br>



</span></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:'Courier New',courier,monaco,monospace,sans-serif"><span style="font-family:'Courier New',courier,monaco,monospace,sans-serif;font-size:13px">Appreciate any points that you can provide.<br>



</span><br></div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:'Courier New',courier,monaco,monospace,sans-serif">Best regards</div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:'Courier New',courier,monaco,monospace,sans-serif">



Arvind</div><div style="font-style:normal;font-size:13px;background-color:transparent;font-family:'Courier New',courier,monaco,monospace,sans-serif"><br></div></div></div><br></div></div>_______________________________________________<br>




Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br>
<br></blockquote></div>
<br>_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br>