#6381 closed defect (invalid)
Re-encoding png image fails
Reported by: | Thomas Thomas | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avcodec |
Version: | git-master | Keywords: | png |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Summary of the bug: Sometimes Ffmpeg fails to re-encode png file which is correct according to the png file formet specification.
How to reproduce: Try to re-encode this file https://github.com/guest161373/1/blob/master/1.hex (it is a valid png file):
ffmpeg -i 1.hex -y 2.png
Output of Ffmpeg is
[png @ 0000000000574520] inflate returned error -3 Input #0, png_pipe, from '1.hex': Duration: N/A, bitrate: N/A Stream #0:0: Video: png, rgb24(pc), 2400x1500 [SAR 3779:3779 DAR 8:5], 25 tbr, 25 tbn, 25 tbc Output #0, image2, to '1.png': Metadata: encoder : Lavf57.57.100 Stream #0:0: Video: png, rgb24, 2400x1500 [SAR 3779:3779 DAR 8:5], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc Metadata: encoder : Lavc57.66.101 png Stream mapping: Stream #0:0 -> #0:0 (png (native) -> png (native)) Press [q] to stop, [?] for help [png @ 00000000005658e0] inflate returned error -3 Error while decoding stream #0:0: Generic error in an external library frame= 0 fps=0.0 q=0.0 Lsize=N/A time=00:00:00.00 bitrate=N/A speed= 0x video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used) Conversion failed!
All other png encoders/decoders can process this file correctly. This is how the image should look like: https://i.imgur.com/Zp0Eau4.png
Change History (4)
comment:1 by , 8 years ago
Component: | ffmpeg → avcodec |
---|
comment:2 by , 8 years ago
Which did you test?
I tested it with a lot of image viewers/editors on windows. All modern browsers can display that image (Chrome, Mozilla, Safari, Opera, IE, etc), you can edit it in Paint, open and edit it with ACDSee Image Viewer, Mirilic Action Image Viewer, Panorama Maker, Image Resizer etc. All of them opens image without anywarnings or errors.
Why do you believe this is a valid png file?
Actually, this is not completely valid png file. One of IDAT chunks has unconsistent CRC32 hash, which means that the file may be corrupted. But, I tested some images with bad CRC32 hashes and Ffmpeg converts them without errors. Also, in this image IEND chunk is missing, and also a few IDAT chunks at the ends. Shouldn't Ffmpeg just fill that part of image with transparent or black pixel data (like all other image editors do)?
comment:3 by , 4 years ago
Resolution: | → needs_more_info |
---|---|
Status: | new → closed |
comment:4 by , 4 years ago
Resolution: | needs_more_info → invalid |
---|
I uploaded the sample.
Some browsers show a line, others simply refuse to open the file, depends maybe on the operating system. In any case, I don't see how the current behaviour can be changed in FFmpeg.
Replying to guest123:
Which did you test? At least libpng fails here.
Why do you believe this is a valid png file?