<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">There can be more than 1 frame per packet and your code assuming that there is only 1 frame per packet.<div>You should do smth like that:</div><div><br></div><div>AVPacket tmp_pkt;</div><div>int size;</div><div><br></div><div>....</div><div><br></div><div>tmp_pkt.data = pkt.data;</div><div>tmp_pkt.size = pkt.size;</div><div><br></div><div>while ( (size = avcodec_decode_video2(ctx,frame,&got_pict,&tmp_pkt) ) > 0)</div><div>{</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>store_decoded_frame(frame);</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>tmp_pkt.data += size;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>tmp_pkt.size -= size;</div><div>}</div><div><br></div><div><br><div><div>24.03.2013, Χ 16:23, Pauli Suuraho ΞΑΠΙΣΑΜ(Α):</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Hello all.</span><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">I'm a newcomer to use ffmpeg, and I've been bugging my mind about this one thing.</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">I have videoclips (either h264 or prores), and I want to extract all the frames. I'm using 32 bit ffmpeg-20130322-git-e0e8c20-win32 zeranoe shared+dev and Qt compiled using MSVC2010.</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">I'm using the following code to extract the frames.</div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px"><a href="http://pastebin.com/DrC9H6g0" target="_blank">http://pastebin.com/DrC9H6g0</a><br></div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">If I have a test clip that is 30 frames, 30fps long, for some reason the lib always extracts only 24 frames and then says end of file.</div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">FFmpeg.exe extracts all the frames (for example to PNGs) correctly. So clearly I'm doing something wrong.</div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">This happens with every clip I have. I've even tried to repack the clips with ffmpeg but the output is same: last frames won't get noticed.<br></div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">I guess this has something to do with I,P,B-frames, but not sure how.<br></div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">Any help is appreciated!</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
Thanks,</div><div style="font-family:arial,sans-serif;font-size:13px">Pauli</div></div>
_______________________________________________<br>Libav-user mailing list<br><a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br>http://ffmpeg.org/mailman/listinfo/libav-user<br></blockquote></div><br></div></body></html>