[Libav-user] Repeating frames

Tony Glover T.Glover at nottingham.ac.uk
Thu Oct 25 11:50:56 CEST 2012

I'm using avcodec_decode_video2() to decode h264 frames encoded by
x264 one frame at a time. The stream is being transmitted over a lossy physical layer wireless channel prior to decoding. I'm trying to implement logic to re-display the last good picture if the current picture fails to decode for whatever reason. The logic I tried was to simply memcpy(lastGoodFrame, currFrame, sizeof(AVFrame)) each time got_picture_ptr is true and if got_picture_ptr is false then I display lastGoodFrame instead of currFrame. However, I'm getting unexpected behavior and blocking patterns. I suspect that this is due to libav doing interframe prediction decoding. Is this the case? Is there a way to do what I'm trying to accomplish?

Hi Tim,
	Re-displaying the last picture is probably not what you want to do - at best your stream will appear frozen with the last good image while the successive ones are not displayed, and then jump about when correctly decoded images arrive. I would ascertain just how much data is being lost and where it happens, if you can, and potentially follow some of the options I previously posted.

Try your software over your own internal network, i.e. plug all the computers into their own switch/router. This will then give you an idea if there are inherent issues with your software, or the network really is a factor, or your software is not coping too well with a lossy network, or indeed something else.

Good luck with it!



This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it.   Please do not use, copy or disclose the information contained in this message or in any attachment.  Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.

This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.

More information about the Libav-user mailing list