Opened 13 months ago

Last modified 13 months ago

#10288 new defect

defect: concat does not skip video errors

Reported by: Lyubomir Filipov Owned by:
Priority: normal Component: avfilter
Version: 4.3.5 Keywords: concat
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by Lyubomir Filipov)

Summary of the bug:

I am using concat in order to create a timelapse video. However, it happens, that from 50GB files a single file is corrupt. The corruption consists in the following:

When playing the video, it starts normally but at some exact time, 5 seconds from it cannot be played. ffplay outputs errors

[aac @ 0x55bdaf31c3c0] Number of bands (13) exceeds limit (8).itrate=21842.8kbits/s speed=36.3x
Error while decoding stream #0:1: Invalid data found when processing input

but after skipping these 5 seconds, the playback continues. This is ok, the file is corrupt and I do not care about these 5 seconds.

The problem is with concat. I have a list of files and I do not know if there is a problem in any of them. Their total length is 5 hours and their total size is 50GB.

when concat encounters the same problematic file, it outputs the error:

[aac @ 0x55e6c2a369c0] Number of bands (13) exceeds limit (8).itrate=21771.2kbits/s speed=34.8x
Error while decoding stream #0:1: Invalid data found when processing input
[concat @ 0x55e6c259d140] h264_mp4toannexb filter failed to receive output packet
timelapse_test/list-tiny.txt: Invalid data found when processing input

and stops without even trying to skip the error or even ignoring the file at all
Both playing the file with vlc or ffplay or even converting it with ffmpeg have the proper behavior - they skip the problematic area (5 seconds) and continue the video playback

I even noticed that the error is related to the aac audio codec. As I do not need audio in the timelapse that I am creating, I added the -an option in order to ignore audio. Now converting with ffmpeg does not result in error, but converting with concat still produces an error and aborts the processing.

Creating a timelapse video this way is very tedious. I have to start the process, which takes hours, and if there is an error, I have to find the erroneous video (concat does not even print the file name which has caused an error), manually find the problematic area, convert it so that I crop this area, put it back in the file list and start the timelapse again... until the next error.

I have also tried running ffprobe on the problematic video, but it does not find any error - it seems that it does not scan the entire file

How to reproduce:

(concat example with a single file)
% ffmpeg -f concat -safe 0 -i <(echo file '/media/nuclear/0000-0001/DCIM/Movie/2023_0318_111248_005.MP4') -vcodec copy -an concat-copy.mp4

result:

[concat @ 0x55d676fae180] h264_mp4toannexb filter failed to receive output packet/s speed=54.7x    
/dev/fd/63: Invalid data found when processing input
frame=12641 fps=3297 q=-1.0 Lsize=  558073kB time=00:03:30.66 bitrate=21701.3kbits/s speed=54.9x    
video:558011kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.011056%

The resulting video length is 3:30, where the problematic area start. If there are multiple files in the list, the processing will stop on the first corrupt file, which breaks processing multiple files using concat

(no concat)
ffmpeg -i /media/nuclear/0000-0001/DCIM/Movie/2023_0318_111248_005.MP4  -vcodec copy -an file-copy.mp4

result: (no errors)
frame=18000 fps=4000 q=-1.0 Lsize=  780377kB time=00:04:59.98 bitrate=21310.7kbits/s speed=66.7x    
video:780291kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.011070%

The resulting video has the entire length (5 minutes). At 3:30 it freezes for 5 seconds and then continues normally (which is the expected behavior, as the input file is corrupted)

ffmpeg version 4.3.1-4ubuntu1 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 10 (Ubuntu 10.2.0-9ubuntu2)

Happens also on

ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.2.0-19ubuntu1)


Change History (4)

comment:1 by Lyubomir Filipov, 13 months ago

Description: modified (diff)

comment:2 by Lyubomir Filipov, 13 months ago

Description: modified (diff)

comment:3 by Lyubomir Filipov, 13 months ago

Version: unspecified4.3.5

comment:4 by Lyubomir Filipov, 13 months ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.