<div dir="ltr">Hi Andrey,<div><br></div><div>PLEASE: I am not sure what I am about to say (better if somebody can correct me).</div><div><br></div><div>I think that if you try to decode a AVPacket it may not return the actual packet, but the previous one. This is because the bidirectional prediction. This means that maybe you will decode the AVPacket with the keyframe in the next iteration using the next AVPacket.</div>
</div><div class="gmail_extra"><br clear="all"><div><font color="#666666"><div><font color="#666666">--</font></div>Dídac Pérez</font><div><br></div></div>
<br><br><div class="gmail_quote">2014-04-03 3:28 GMT+02:00 Andrey Utkin <span dir="ltr"><<a href="mailto:andrey.krieger.utkin@gmail.com" target="_blank">andrey.krieger.utkin@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all!<br>
I am checking a C application using ffmpeg libs, which does the following:<br>
it demuxes h264 stream from RTSP channel, and, when an event happens,<br>
it waits for next keyframe (determined with AVPacket.flags &<br>
AV_PKT_FLAG_KEY), creates appropriate decoder AVCodecContext for it,<br>
and decodes the frame for further processing. The idea is that having<br>
a keyframe, we can decode just single encoded frame and get valid<br>
picture. This approach must have been working correctly in practice,<br>
but now i have it not working with h264 stream from IP camera Axis<br>
M1034-W; the decoding operation indicates that we got no picture (by a<br>
avcodec_decode_video2() flag parameter), and prints<br>
[h264 @ blah] no picture<br>
<br>
This shouldn't be RTP loss, the camera is connected directly to my PC<br>
with a patchcord.<br>
If that is needed, i can share a remuxed stream dump.<br>
BTW Is there an easy way to print out the types of encoded h264 frames<br>
(I, P, B...)?<br>
<br>
Could please somebody elaborate what exactly happens? Is above<br>
approach generally broken, or it can be fixed (without decoding a lot<br>
more frames)?<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Andrey Utkin<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>
</font></span></blockquote></div><br></div>