Opened 10 years ago

Closed 10 years ago

#707 closed enhancement (fixed)

iff: support transparency

Reported by: ami_stuff Owned by:
Priority: wish Component: avcodec
Version: git-master Keywords: iff alpha
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

C:\>ffmpeg -i DpaintTitle.brush
ffmpeg version N-35295-gb55dd10, Copyright (c) 2000-2011 the FFmpeg developers
  built on Nov 30 2011 00:52:52 with gcc 4.6.2
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-ru
ntime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libope
ncore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --en
able-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger -
-enable-libspeex --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwben
c --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-
libxvid --enable-zlib
  libavutil    51. 29. 1 / 51. 29. 1
  libavcodec   53. 39. 1 / 53. 39. 1
  libavformat  53. 22. 0 / 53. 22. 0
  libavdevice  53.  4. 0 / 53.  4. 0
  libavfilter   2. 50. 0 /  2. 50. 0
  libswscale    2.  1. 0 /  2.  1. 0
  libpostproc  51.  2. 0 / 51.  2. 0
[iff_byterun1 @ 020B90E0] Transparency not supported
    Last message repeated 1 times
[IFF @ 020B2320] Estimating duration from bitrate, this may be inaccurate
Input #0, IFF, from 'DpaintTitle.brush':
  Metadata:
    title           : DPaint 5 Title
    artist          : Geoffrey Rantala
    copyright       : 1994, Electronic Arts
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: iff_byterun1 (ILBM / 0x4D424C49), pal8, 275x84, SAR 44:5
2 DAR 3025:1092, 90k tbr, 90k tbn, 90k tbc
At least one output file must be specified
C:\>ffmpeg -i 1.lbm
ffmpeg version N-35295-gb55dd10, Copyright (c) 2000-2011 the FFmpeg developers
  built on Nov 30 2011 00:52:52 with gcc 4.6.2
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-ru
ntime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libope
ncore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --en
able-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger -
-enable-libspeex --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwben
c --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-
libxvid --enable-zlib
  libavutil    51. 29. 1 / 51. 29. 1
  libavcodec   53. 39. 1 / 53. 39. 1
  libavformat  53. 22. 0 / 53. 22. 0
  libavdevice  53.  4. 0 / 53.  4. 0
  libavfilter   2. 50. 0 /  2. 50. 0
  libswscale    2.  1. 0 /  2.  1. 0
  libpostproc  51.  2. 0 / 51.  2. 0
[iff_ilbm @ 020B90E0] Transparency not supported
    Last message repeated 1 times
[IFF @ 020B2320] Estimating duration from bitrate, this may be inaccurate
Input #0, IFF, from '1.lbm':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: iff_ilbm (PBM  / 0x204D4250), pal8, 21x21, SAR 5:6 DAR 5
:6, 90k tbr, 90k tbn, 90k tbc
At least one output file must be specified

Attachments (5)

1.lbm (2.0 KB ) - added by ami_stuff 10 years ago.
DpaintTitle.brush (6.8 KB ) - added by ami_stuff 10 years ago.
test.rar (14.2 KB ) - added by ami_stuff 10 years ago.
brown_ham8.brush (7.1 KB ) - added by ami_stuff 10 years ago.
patchifftransparency.diff (1.1 KB ) - added by Carl Eugen Hoyos 10 years ago.

Download all attachments as: .zip

Change History (15)

by ami_stuff, 10 years ago

Attachment: 1.lbm added

by ami_stuff, 10 years ago

Attachment: DpaintTitle.brush added

comment:1 by Carl Eugen Hoyos, 10 years ago

Component: undeterminedavcodec
Keywords: iff alpha added
Priority: normalwish
Reproduced by developer: set
Status: newopen
Type: defectenhancement
Version: unspecifiedgit-master

Patch attached.

comment:2 by ami_stuff, 10 years ago

The attached patch seems to work correctly with "DpaintTitle.brush" file, hoever it fails with iff ilbm files which I created with different background colors selected as transparent.

maybe this info will be useful:

http://home.comcast.net/~erniew/lwsdk/docs/filefmts/ilbm.html

by ami_stuff, 10 years ago

Attachment: test.rar added

comment:3 by Carl Eugen Hoyos, 10 years ago

Works fine here with my patch:
ffmpeg -i brown.brush -pix_fmt rgb32 out.png
(out.png has transparent background)

comment:4 by ami_stuff, 10 years ago

Right, it works with -pix_fmt rgb32. I tested without it and only "dpainttitle.brush" converted with transparency.

ffmpeg -i *.brush out.png

comment:5 by Carl Eugen Hoyos, 10 years ago

I fixed ffmpeg -i brown.brush out.png earlier today (unrelated to iff).

Please try to always add a failing command line (ffmpeg -i brown.brush out.png) and complete, uncut output, it makes understanding a problem much easier.

comment:6 by ami_stuff, 10 years ago

if (s->masking & !MASK_HAS_TRANSPARENT_COLOR != MASK_NONE) { 
av_log(avctx, AV_LOG_ERROR, "Masking not supported\n"); 
return AVERROR_PATCHWELCOME; 
} 

This check seems to fail (allow decoding) file from ticket #705, so maybe something like this:

if (s->masking && s->masking != MASK_HAS_TRANSPARENT_COLOR) {
av_log(avctx, AV_LOG_ERROR, "Masking not supported\n");
return AVERROR_PATCHWELCOME;
}

Also I have created HAM8 file with transparency (and this seems to set automaticly masking as well), but maybe it would be ok to apply this patch and experiment with HAM8 sample when masking will be supported?

Last edited 10 years ago by ami_stuff (previous) (diff)

by ami_stuff, 10 years ago

Attachment: brown_ham8.brush added

by Carl Eugen Hoyos, 10 years ago

Attachment: patchifftransparency.diff added

comment:7 by Carl Eugen Hoyos, 10 years ago

Thank you for testing and suggesting a fix, new patch attached!

comment:8 by ami_stuff, 10 years ago

the new check is ok

comment:9 by ami_stuff, 10 years ago

please apply this patch

comment:10 by Carl Eugen Hoyos, 10 years ago

Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.