[FFmpeg-user] Display statistics on decode error

Remi Achard remiachard at gmail.com
Thu Aug 8 11:50:05 EEST 2019


I would like to use ffmpeg to check video files integrity in the sense that
every frame can be successfully decoded.

The command line I’m using looks like this :
ffmpeg -v error -xerror -i /my/video/path -f null -

It works but don’t give any clue on where the error was in the stream.

[prores @ 0x7f9761812e00] invalid plane data size
    Last message repeated 78 times
/my/video/path: corrupt decoded frame in stream 0

Ideally, I want to know at what frame the error occurred, to do this I
proposed a patch (
http://ffmpeg.org/pipermail/ffmpeg-devel/2019-July/246498.html), that seems
to work ok. The idea is to only show where the decoding failed without
printing each and every frame statistic along the way (to keep reports and
buffer from overflowing). The command looks like this (notice the verbose
log level because the final statistics are logged as verbose level) :

ffmpeg -v verbose -xerror -i /my/video/path -f null -

[prores @ 0x7fc1dc007c00] ac tex damaged 2049, 2048
[prores @ 0x7fc1dc007c00] invalid plane data size
    Last message repeated 78 times
/my/video/path: corrupt decoded frame in stream 0
video:1034kB audio:7810kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: unknown
Input file #0 (/my/video/path):
  Input stream #0:0 (video): 1976 packets read (1648274256 bytes); 1975
frames decoded;
  Input stream #0:1 (audio): 3997 packets read (11995584 bytes); 3997
frames decoded (3998528 samples);
  Input stream #0:2 (audio): 48 packets read (147072 bytes);
  Input stream #0:3 (data): 0 packets read (0 bytes);
  Total: 6021 packets (1660416912 bytes) demuxed
Output file #0 (pipe:):
  Output stream #0:0 (video): 1975 frames encoded; 1975 packets muxed
(1058600 bytes);
  Output stream #0:1 (audio): 3997 frames encoded (3998528 samples); 3997
packets muxed (7997056 bytes);
  Total: 5972 packets (9055656 bytes) muxed
[AVIOContext @ 0x7fc1dd800080] Statistics: 1687982697 bytes read, 1827 seeks
Conversion failed!

With this I know that error occurred near frame 1975.

Is there a way to already achieve this with ffmpeg-master ?

(Sorry I realise I should have posted here first)


More information about the ffmpeg-user mailing list