Yes, I read all frames, most return value of function 
"ff_avc_parse_nal_units" is 0.<div>i think maybe the problem is about NAL, will the NAL layer of H264 frame be detached in the function "av_read_frame".</div><div>So in the "ff_avc_parse_nal_units", it can't find start code(0x000001), and discard the frame.</div>
<div>Is that right?</div><div><br><div class="gmail_quote">2012/12/25 Alex Cohn <span dir="ltr"><<a href="mailto:alexcohn@netvision.net.il" target="_blank">alexcohn@netvision.net.il</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Tue, Dec 25, 2012 at 11:08 AM, Brian Chi <<a href="mailto:beyond702@gmail.com">beyond702@gmail.com</a>> wrote:<br>
> I tracked the ffmpeg code and found that in the function<br>
> "av_write_frame->mov_write_packet->ff_mov_write_packet", it will call<br>
> function "ff_avc_parse_nal_units" to obtain the size of nal unit, but the<br>
> return value is very small(such as 208 bytes).<br>
<br>
</div>It's very natural for the first NAL unit to be small. An h264 stream<br>
begins with configuration SPS/PPS untis that don't contain video data,<br>
but let the decoder initialization to work. Did you continue reading<br>
more video packets after the first one?<br>
<br>
Alex<br>
_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org">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>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Best Regards,<div>Chi</div>
</div>