[FFmpeg-devel] avcodec_check_frame_for_corruption?

madshi dear
Wed Mar 26 20:52:18 CET 2008

Michael Niedermayer schrieb:
> On Wed, Mar 26, 2008 at 02:28:36PM +0100, Benjamin Larsson wrote:
>> madshi wrote:
>>>  From reading the mailing list it appears to me that
>>> you ffmpeg/libav devs are quite strict with checking
>>> for possible error conditions etc. I like that a lot!
>>> Now I'm wondering:
>>> Is there any chance to add functionality to libav to
>>> make it possible for me as a programmer who uses
>>> libav to check a video or audio frame for corruption?
>>> My understanding is that currently all decoders try
>>> to work around corruption and still let decoding
>>> succeed somehow. E.g. the MPEG2 decoders still
>>> output frames even if the bitstream is damaged.
>>> The problem with that for me is that I cannot
>>> detect whether an audio or video frame was clean
>>> or corrupt. And that is what I'd like to find out.
>>> Maybe the video/audio decoders could set a flag
>>> somewhere when a frame was found to be damaged,
>>> but when decoding still worked fine? Another option
>>> would be if I could tell the decoders to let decoding
>>> fail if there's any corruption found in the bitstream.
>>> What do you think?
>>> Regards, madshi.
>> This sounds like a good feature. A simple approach would be to just add 
>> another avctx member and check it before and after calling decode().
> AVFrame member, or this will be a nightmare with B frame reordering.

I'll gladly take whatever you find best for implementation. However,
using AVFrame would limit this flag to video decoding, right? Well,
that's the main area where I need the "corruption" information. But
I think it could be useful for audio, too, no?

Regards, madshi.

More information about the ffmpeg-devel mailing list