#2275 closed defect (invalid)
artifacts on decoding PNG file with alpha
| Reported by: | Stefano Sabatini | Owned by: | |
|---|---|---|---|
| Priority: | normal | Component: | ffplay |
| Version: | git-master | Keywords: | png alpha sdl |
| Cc: | Blocked By: | ||
| Blocking: | Reproduced by developer: | yes | |
| Analyzed by developer: | yes |
Description
Summary of the bug:
How to reproduce:
fmpeg -i http://ffmpeg.org/ffmpeg-logo.png out.bmp
ffmpeg version N-50039-g9cfe7a3 Copyright (c) 2000-2013 the FFmpeg developers
built on Feb 17 2013 13:21:08 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
configuration: --enable-pic --enable-fontconfig --enable-libschroedinger --enable-libass --enable-version3 --prefix=/home/stefano --enable-libx264 --enable-libfaac --disable-shared --enable-static --enable-debug=3 --enable-pthreads --enable-libvorbis --enable-gpl --enable-nonfree --enable-libmp3lame --enable-libtheora --enable-gpl --enable-x11grab --enable-frei0r --enable-libspeex --enable-libcaca --enable-libflite --enable-libfreetype --enable-libopencv --enable-libopencore-amrnb --enable-libopencore-amrnb --disable-optimizations
libavutil 52. 17.101 / 52. 17.101
libavcodec 54. 92.100 / 54. 92.100
libavformat 54. 63.100 / 54. 63.100
libavdevice 54. 3.103 / 54. 3.103
libavfilter 3. 38.103 / 3. 38.103
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
Input #0, image2, from 'http://ffmpeg.org/ffmpeg-logo.png':
Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
Stream #0:0: Video: png, rgba, 396x100, 25 tbr, 25 tbn, 25 tbc
Output #0, image2, to 'out.bmp':
Metadata:
encoder : Lavf54.63.100
Stream #0:0: Video: bmp, bgra, 396x100, q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (png -> bmp)
Press [q] to stop, [?] for help
frame= 1 fps=0.0 q=0.0 Lsize=N/A time=00:00:00.04 bitrate=N/A
video:155kB audio:0kB subtitle:0 global headers:0kB muxing overhead -100.013884%
or alternatively:
ffplay http://ffmpeg.org/ffmpeg-logo.png
The output is garbled.
Change History (5)
comment:1 by , 11 years ago
| Status: | new → open |
|---|
follow-up: 3 comment:2 by , 11 years ago
comment:3 by , 11 years ago
| Analyzed by developer: | set |
|---|---|
| Component: | avcodec → FFplay |
| Keywords: | sdl added |
| Resolution: | → invalid |
| Status: | open → closed |
Replying to cehoyos:
Is there really an issue?
ImageMagick decodes exactly the same (invisible) artefacts as FFmpeg.
Indeed there isn't.
Check with:
ffplay -f lavfi "color=s=400x300:c=white[bg]; movie=ffmpeg-logo.png, [bg] overlay"
or
ffplay ffmpeg-logo.png -vf alphaextract
libswscale is stripping the alpha plane when converting from RGBA to YUV, and the display is the natural result of this operation, the only sane path would be to make SDL support alpha, but this is unrelated to FFmpeg.
Sorry for the noise.
follow-up: 5 comment:4 by , 11 years ago
I tested with several web-browsers and they all show a white background as gimp does, so maybe there is the same bug present in ImageMagick and FFmpeg.
comment:5 by , 11 years ago
Replying to cehoyos:
I tested with several web-browsers and they all show a white background as gimp does, so maybe there is the same bug present in ImageMagick and FFmpeg.
As I explained this is not a bug, as there is no "correct" way to drop the alpha channel and preserve information.



Is there really an issue?
ImageMagick decodes exactly the same (invisible) artefacts as FFmpeg.