Opened 8 months ago

Last modified 8 months ago

#9535 new defect

PNG decoder fails processing more than a certain number of frames

Reported by: panthalassa Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords: png decoding pattern_type glob
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by panthalassa)

Summary of the bug: trying to encode a video from .png sequence with more than a certain number of frames in a given directory results in corrupted output and an out-of-memory scenario

How to reproduce:
Sorry but due to the absurd bandwith requirements I likely won't be able to upload the offending files. This can likely be reproduced by converting a long, losslessly compressed video into a sufficient number of PNG's (my stats: 11 minute 1080p video at 60fps = ~39,000 frames, each frame 1.9mb making the uncompressed video around 80gb) I acquired these frames from rendering in Blender

Present on all versions I've tested from 3.4.8 to 4.4.1. Any png-based input fails with too many files in the directory - symptoms include the encoded video having scrambled frame order after about 1000 frames, as well as the [png @ 0x??? chunk too big] error after 11000 to 14750 processed frames depending on settings.

Sending a kill signal for a soft quit producing a video of just over 1000 frames displays the same issue.

Taking a generous swathe of images around the error points and processing them separately produces no errors implying that a corrupted PNG is not to blame.

Putting a smaller (1-2000) number of frames in a directory and processing them separately produces a successful result longer than 1000 frames, past the previous point of onset for corruption. Unknown exactly how many frames are needed to cause the error.

Any format encoding that receiving raw PNG input appears to be bugged - libx264rgb, libx265, ffv1 tested

Latest tested version: clean install of N-104671-g2cddb2f7a8 on a live USB of Linux Mint 19.1 MATE following the instructions on the Compile FFMPEG page

% ffmpeg -framerate 60 -f image2 -pattern_type glob -i $1'/*.png' -vcodec libx265 -pix_fmt yuv420p10le -vf scale=out_range=pc $2

% ffmpeg -framerate 60 -f image2 -pattern_type glob -i $1'/*.png' -vcodec ffv1 -coder 1 -level 3 -threads 4 -slices 4 -pix_fmt bgra $2

ffmpeg version: N-104671-g2cddb2f7a8
built on ... Linux Mint 19.1 MATE live USB

Change History (10)

comment:1 by panthalassa, 8 months ago

I have uploaded a corrupted example file to the VideoLAN uploader what do I need do to move it here

Also there could be a confounding factor - I am performing this operation on a FUSE based NTFS filesystem, will attempt to reproduce on ext4

comment:2 by panthalassa, 8 months ago

Description: modified (diff)

comment:3 by panthalassa, 8 months ago

Description: modified (diff)

comment:4 by panthalassa, 8 months ago

Nope, issue persists on an ext4 filesystem

comment:5 by panthalassa, 8 months ago

Description: modified (diff)

comment:6 by mkver, 8 months ago

I presume you uploaded this (at least the description says it belongs to this ticket). You could have used a more descriptive title than "test.mkv".

in reply to:  6 comment:7 by panthalassa, 8 months ago

Replying to mkver:

that's the one sorry yes, clicked through before I checked everything properly. what can't be gleaned from the video is that around the 1000th frame, the sudden frames flashing are from very far into the rest of the series. Like it seems to go from 1000, to 10,000, to 1001, to 10,001, to 1002, to 10,002, and so forth

Last edited 8 months ago by panthalassa (previous) (diff)

comment:8 by panthalassa, 8 months ago

Keywords: pattern_type glob added

Ok after some more testing I've narrowed it down to the -pattern_type glob option. With this option enabled and using *.png for input causes the aforementioned symptoms. Removing this option and using %04d.png as input works successfully with no glitches

comment:9 by panthalassa, 8 months ago

The odd part is that I've been using the unmodified script for years successfully. I have a variety of videos on Youtube made with glob input. However I did take a solid year off making videos, when I came back and updated stuff is when I noticed this issue. There's a chance this issue came about within the timeframe between now and December 2019 which is the date of the last video I posted, however I don't know what version I was running then so it's likely I had a build somewhat older than that

Last edited 8 months ago by panthalassa (previous) (diff)

comment:10 by panthalassa, 8 months ago

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