<div dir="ltr"><div><div><div>Hi,<br><br></div>How do you decode your frames? If you wanna know when decoding of a frame is finished why not using int *got_picture_ptr which gets modified (returns) by avcodec_decode_video2?<br><br></div>Regards,<br></div>Maziar Mehrabi<br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><span style="color:rgb(102,0,102);font-family:monospace,fixed"><br></span></div><span style="color:rgb(102,0,102);font-family:monospace,fixed"><div><span style="color:rgb(102,0,102);font-family:monospace,fixed">--</span></div>Hälsningar,</span><br style="padding:0px;margin:0px;color:rgb(102,0,102);font-family:monospace,fixed"><span style="color:rgb(102,0,102);font-family:monospace,fixed">Maziar Mehrabi</span>,<br></div></div></div>
<br><div class="gmail_quote">On Wed, Dec 10, 2014 at 10:50 AM, Alina lifshits <span dir="ltr"><<a href="mailto:alina@vicon.co.il" target="_blank">alina@vicon.co.il</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div link="blue" vlink="purple" lang="EN-US"><div><p class="MsoNormal">Hello,<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I am decoding h264 live stream (I-Frames & P-Frames only) and the FF_THREAD_FRAME flag is turned off to keep small latency.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">In my app I need to know exactly when an AVPacket is decoded and produces an AVFrame. To do so I am using the AVFrame.pkt_pts and AVFrame.pkt_dts fields to find the AVPacket this frame was produced of. Most of the time everything works as expected. Each AVPacket input produces AVFrame output and the fields are matching. But I do have a stream when the behavior is different:<u></u><u></u></p><p class="MsoNormal">The first frame: AVPacket1 <span style="font-family:Wingdings">ā</span> AVFrame1 and all is OK. The resulting AVFrame1.ptk_pts == AVPacket1.pts and AVFrame1.ptk_dts == AVPacket1.dts and the produced frame is an I_FRAME.<u></u><u></u></p><p class="MsoNormal">The second frame: AVPacket2 <span style="font-family:Wingdings">ā</span> AVFrame2. The resulting AVFrame2.pkt_dts == AVPacket2.dts BUT AVFrame2.pkt_pts != AVPacket2.pts, instead AVFrame2.pkt_pts == AVPacket1.pts!!!! and the produced frame is again an I_FRAME. The is unexpected, the second frame should be a P-FRAME (according to the h264 stream) and now I cannot tell for sure that the second AVFrame2 was produced from AVPacker2. Was it? Or the decoder returns twice the same frame?<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">My main questions is if using the pkt_pts & pkt_dts is the right solution for me? Is there a most reliable way to do it?<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Many thanks,<u></u><u></u></p><p class="MsoNormal">Alina<u></u><u></u></p></div></div><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>
<br></blockquote></div><br></div>