Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to interprete ffmpeg AVERROR

Anybody knows where is a list of the AVERROR meanings? Something like

-1: reason A
-2: reason B

and so forth?

like image 987
ticofab Avatar asked Jul 20 '12 13:07

ticofab


3 Answers

You can use av_strerror() to get a string representation of the error code.

If you simply want to look it up, you can refer to the docs for libavutil/error.c and libavutil/error.h.

like image 95
Shawn Chin Avatar answered Oct 18 '22 12:10

Shawn Chin


Use

printf("%s", av_err2str(ret));

where ret is the integer returned from a function (e.g. avformat_open_input(...)).

like image 42
dajuric Avatar answered Oct 18 '22 13:10

dajuric


Here you go (taken from libavutil/error.c):

{ ERROR_TAG(BSF_NOT_FOUND),      "Bitstream filter not found"                     },
{ ERROR_TAG(BUG),                "Internal bug, should not have happened"         },
{ ERROR_TAG(BUG2),               "Internal bug, should not have happened"         },
{ ERROR_TAG(BUFFER_TOO_SMALL),   "Buffer too small"                               },
{ ERROR_TAG(DECODER_NOT_FOUND),  "Decoder not found"                              },
{ ERROR_TAG(DEMUXER_NOT_FOUND),  "Demuxer not found"                              },
{ ERROR_TAG(ENCODER_NOT_FOUND),  "Encoder not found"                              },
{ ERROR_TAG(EOF),                "End of file"                                    },
{ ERROR_TAG(EXIT),               "Immediate exit requested"                       },
{ ERROR_TAG(EXTERNAL),           "Generic error in an external library"           },
{ ERROR_TAG(FILTER_NOT_FOUND),   "Filter not found"                               },
{ ERROR_TAG(INVALIDDATA),        "Invalid data found when processing input"       },
{ ERROR_TAG(MUXER_NOT_FOUND),    "Muxer not found"                                },
{ ERROR_TAG(OPTION_NOT_FOUND),   "Option not found"                               },
{ ERROR_TAG(PATCHWELCOME),       "Not yet implemented in FFmpeg, patches welcome" },
{ ERROR_TAG(PROTOCOL_NOT_FOUND), "Protocol not found"                             },
{ ERROR_TAG(STREAM_NOT_FOUND),   "Stream not found"                               },
{ ERROR_TAG(UNKNOWN),            "Unknown error occurred"                         },

But this is version-dependent way and it is better to use av_strerror() to let the library give you a string representation of the error code.

like image 26
Sergey K. Avatar answered Oct 18 '22 13:10

Sergey K.