[FFmpeg-devel] [QUESTION] Proper handling and reporting of decoding errors

Maxim max_pole at gmx.de
Fri Jun 10 00:36:50 CEST 2011


Hi crews,

I would gladly understand how FFmpeg/libav handles decoding errors. I
need that information in order to implement proper error handling in my
indeo decoders.

case 1: my decoder encounters a broken P-frame. That usually means that
all following frames until the next key one will be broken as well. The
proper reaction would be to wait for the key frame.
What kind of signal does the calling library expect in this case? Error
code/empty frame?
Should I introduce some kind "need_resync" flag in the decoder and skip
broken frames internally or is there any possibility to report broken
frames to the caller?

case 2: indeo codecs uses sometimes so-called "sync"-frames. The frame
data just contain a short header (16 bytes) indicating that nothing has
changed. I guess that feature or hack was introduced in order to enable
variable frame rate which isn't otherwise provided in the AVI container.

Returning previous frame and reporting number of consumed bytes should
be fine in that case, shouldn't it?
Would it introduce duplicated frames?

case 3: temporal scalability. Indeo serie of codecs uses a special kind
of P-frames whose can be easily dropped without damaging the whole video
sequence. What kind of signal will be send to decoder in order to
request frame dropping? The "avctx->hurry_up" flag I used in the
previous version of my indeo3 decoder is deprecated meanwhile...

Thanks in advance
Best regards
Maxim Poliakovski


More information about the ffmpeg-devel mailing list