<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Yes, you need to flush decoder also.</div><div>You had errors while decoding because simple copying AVPacket's data and size no longer works(sorry, it was my fault). It should be like following:</div><div><br></div><div>uint8_t *orig_ptr;</div><div>ssize_t orig_size;</div><div><br></div><div>orig_ptr = pkt.data;</div><div>orig_size = pkt.size;</div><div><br></div><div>while (pkt.size > 0 && (size = av_decode_video2()) > 0)</div><div>{</div><div><span class="Apple-tab-span" style="white-space:pre">     </span>pkt.data += size;</div><div><span class="Apple-tab-span" style="white-space:pre">    </span>pkt.size -= size;</div><div>}</div><div><br></div><div>pkt.data = orig_ptr;</div><div>pkt.size = orig_size;</div><div><br></div><div>av_free_packet(pkt);</div><div><br></div><div><div>24.03.2013, Χ 17:42, Pauli Suuraho ΞΑΠΙΣΑΜ(Α):</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">> <span style="font-family:arial,sans-serif;font-size:13px">This code is not very readable, due to the ugly c++ coding style and bloat.</span><div><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div><div style=""><span style="font-family:arial,sans-serif;font-size:13px">Oh, sorry you had problems reading my code.</span></div><div style=""><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div>
<div style=""><span style="font-family:arial,sans-serif;font-size:13px">>If I read it correctly, you are forgetting to flush the decoder after the</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">>end of the stream. You have to feed empty packets to the decoder until it</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">>returns no frame.</span><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div style=""><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div><div style=""><span style="font-family:arial,sans-serif;font-size:13px">That's it! </span><font face="arial, sans-serif">demuxing.c example had example how to flush the codec.</font></div><div style=""><font face="arial, sans-serif"><br>
</font></div><div style=""><font face="arial, sans-serif">Now I'm nicely getting all the frames, well at least if there is one frame per packet.</font></div><div style=""><font face="arial, sans-serif"><br></font></div><div style="">
<font face="arial, sans-serif">-Pauli</font></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></body></html>