From: Michael Niedermayer <michael@niedermayer.cc> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Subject: Re: [FFmpeg-devel] [RFC] Advanced Error Codes Date: Wed, 2 Jul 2025 19:16:41 +0200 Message-ID: <20250702171641.GF29660@pb2> (raw) In-Reply-To: <aGVHypOhb2JfUbhc@phare.normalesup.org> [-- Attachment #1.1: Type: text/plain, Size: 2521 bytes --] Hi Nicolas On Wed, Jul 02, 2025 at 04:52:58PM +0200, Nicolas George wrote: > Michael Niedermayer (HE12025-07-02): > > People are asking for better error codes > > I have little time just now, but I think it is important to clarify: > > - Error CODES are for when the program must react specifically to a > certain kind of error condition: > > if (ret == AVERROR(EAGAIN)) … > > - Error MESSAGES are to say to the user what went wrong. > > There is a confusion because error codes also serve as stock error > messages. its a bit fuzzy, for example AVERROR(EAGAIN) is for the program but AVERROR_PATCHWELCOME is for the developer while AVERROR_PROTOCOL_NOT_FOUND is for the one building the lib and a EOF is for the one supplying the input file > > I think what we need is better error messages and accompanying > reporting. I have a lot of thoughts about this, I will comment when I > have more time. (Spoiler: it depends on AVWriter.) The av_log() messages work for a specific use case, that is command line tools and for advanced users and developers who are not intimidated by going through log files. AND have the time to go through the log files They do not work that well in many cases Consider this: * You want to make a list of all "failure to decode" reasons of h264 files - The current error codes are useless (always INVALIDDATA), the messages come without synchronization from multiple threads, its not possible to reliably pick the root failure reason out of these for a decode() caller + With what i suggested, this is solved, you get a int64 code, you can look it up and you know what the cause of the failure was, in what source file and location it was and so on * A GUI Player or Transcoder hits an error - The current error codes are useless (maybe INVALIDDATA again) maybe the GUI can present the user with a log window, but the last 3 might not be the relevant error messages + With what i suggested, you get a int64 code, you can look it up and you know what the cause of the failure was, in what source file and location it was, what URL caused it maybe and so on and the GUI can take this and cleanly present it to the user in a error message box [will send 2nd mail to keep this clearer] thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Those who are too smart to engage in politics are punished by being governed by those who are dumber. -- Plato [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 195 bytes --] [-- Attachment #2: Type: text/plain, Size: 251 bytes --] _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2025-07-02 17:16 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2025-07-02 14:43 Michael Niedermayer 2025-07-02 14:52 ` Nicolas George 2025-07-02 17:16 ` Michael Niedermayer [this message] 2025-07-02 17:21 ` Michael Niedermayer
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20250702171641.GF29660@pb2 \ --to=michael@niedermayer.cc \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git