Log in

View Full Version : Understanding ffmpeg output for corrupted files


j7n
6th December 2023, 23:10
I've heard a suggestion to use ffmpeg for verifying file integrity. I have a couple questions about it. I am lost in the multitude of params the program takes.

Can I get a position in the stream where the error is detected either as time or bytes? Can I get a report about multiple errors per stream?

It seems report only one error. The number in square brackets it gives for what looks like the position keeps changing with multiple invocations. It also seems to print this stuff above other grey text on Windows, which is probably OK.

ffmpeg-git\ffmpeg -i acorrupted.ac3 -f null NUL

[ac3 @ 00000000005d2680] error decoding the audio block
.....
[ac3 @ 00000000004d2680] error decoding the audio block
...
[ac3 @ 00000000005c2680] error decoding the audio block

therube
11th December 2023, 19:23
The number in square brackets it gives for what looks like the position keeps changing with multiple invocations.
You're saying you get the same results, though the (I guess it is a timecode) changes for different runs - on the same file?


Something I whipped up some time back.
I used -v error.

:: ffmpeg check to see if a video is good
:: SjB
:: 05/23/2019


@echo off
echo.
echo CHECKING VIDEO FOR ERRORS:
echo %1
if [%2] NEQ [] echo [Output to screen only.]
echo.
pause
echo.

if [%2] NEQ [] goto 2screenonly



@echo on
ffmpeg -i "%~1" -v error -f null - 2>&1 | tee "%~1_ERROR.log"
echo DONE >> "%~1_ERROR.log"

pause
exit



:2screenonly
@echo on
ffmpeg -i "%~1" -v error -f null - 2>&1
echo DONE

pause
:exit
:do NOT (specifically) exit, rather just do "nothing"
:such that the command prompt window simply "exits" rather then closes

j7n
12th December 2023, 01:22
"-v error" is useful for suppressing other text output. But when doing a batch of multiple files, the output doesn't include the names. Or anything else apart from the error.

Yes, the "timecode" changes for the same input file. It does sometimes report more than 1 error, and then the number is the same for all errors, which means it is unfortunately not a position in the file. It seems ffmpeg only finds some errors that are in critical places in the bitstream.