[FFmpeg-devel] avcodec_check_frame_for_corruption?

Michael Niedermayer michaelni
Wed Mar 26 21:27:09 CET 2008


On Wed, Mar 26, 2008 at 08:52:18PM +0100, madshi wrote:
> 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?

audio should be changed to use AVFrame as well

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080326/3c6b86c8/attachment.pgp>



More information about the ffmpeg-devel mailing list