I am testing this command line on a known bad file.
ffmpeg.exe -hide_banner -max_error_rate 0.001 -i  %1  $$temp.mp3
I get a lot of verbage about errors, but no exitcode other than zero.




    On Tuesday, October 14, 2025 at 10:01:58 PM PDT, Gyan Doshi via ffmpeg-user 
<[email protected]> wrote:  
 
 

On 2025-10-15 12:59 am, Bruce Gavin via ffmpeg-user wrote:
> I am using ffmpeg essentials 8 to do integrity testing on supported file 
> types.I consistently get an exit code = 0, even with a lot of text on STDOUT 
> talking about invalid headers, bad data, etc.
> I am using this command in a Windows CMD file:ffmpeg.exe -v warning -i %1 -f 
> null -
> and testing %ERRORLEVEL% for zero
> Q:  is there a simple command line that will give me an accurate Zero or 
> Non-Zero for file integrity?

The exit code isn't meant to signal file integrity status - it's for 
fatal output errors.

ffmpeg does have an option to return an exit code to signal decoding 
failure based on fraction of frames with decode failures, which is
-max_error_rate <fraction>
e.g. -max_error_rate 0.4 will cause ffmpeg to exit with code 69 if 40%+ 
of input frames fail to decode. Default value is 2/3.

Regards,
Gyan

_______________________________________________
ffmpeg-user mailing list -- [email protected]
To unsubscribe send an email to [email protected]
  
_______________________________________________
ffmpeg-user mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to