Opened 5 years ago

Last modified 4 years ago

#1286 open defect

qt tiff pal8 enc: wrong colors in qt

Reported by: ami_stuff Owned by:
Priority: minor Component: undetermined
Version: git-master Keywords: mov pal8
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

I have tried to find out why mov tiff pal8 files doesn't decode with correct colors in qt
(probably the same reason would be for png/tga pal8 in mov).

pal8_qt.tif - tiff 8bpp exported from qt

ffmpeg -i pal8_qt.tif -vcodec tiff -pix_fmt pal8 pal8.mov - decodes with correct colors in qt (no swscale)

(
or

ffmpeg -i pal8_qt.tif -pix_fmt pal8 pal8_ff.tif
ffmpeg -i pal8_ff.tif -vcodec tiff -pix_fmt pal8 pal8.mov - decodes with correct colors in qt (no swscale)
}

ffmpeg -i pal8_qt.tif -pix_fmt rgb24 rgb24.tif
ffmpeg -i rgb24.tif -vcodec tiff -pix_fmt pal8 pal8_from_rgb24.mov - decodes with wrong colors in qt (swscale - rgb24 -> pal8)

(or

ffmpeg -i pal8_qt.tif -s 32x32 -pix_fmt pal8 pal8_ff_32.tif
ffmpeg -i pal8_ff_32.tif -vcodec tif -vcodec tiff -pix_fmt pal8 pal8_ff_32.mov) - decodes with wrong colors in qt (swscale - resize)
}

now when I modify $F7 value to $F8 (see pal8_diff.jpg) in pal8_from_rgb24.mov file and copy/paste
mdat hunk from pal8.mov (see pal8.jpg) to pal8_from_rgb24.mov (see pal8_from_rgb24.jpg) then modified
file have correct colors in qt, so looks like the problem is in data exported by ffmpeg when conversion
to pal8 happens (and swscale is used).

Attachments (1)

all.rar (269.5 KB) - added by ami_stuff 5 years ago.

Download all attachments as: .zip

Change History (3)

Changed 5 years ago by ami_stuff

comment:1 in reply to: ↑ description Changed 5 years ago by cehoyos

  • Keywords mov palette added
  • Priority changed from normal to minor
  • Reproduced by developer set
  • Status changed from new to open
  • Version changed from unspecified to git-master

Replying to ami_stuff:

so looks like the problem is in data exported by ffmpeg when conversion
to pal8 happens (and swscale is used).

iirc, qt uses the same palette for encoding (no matter the input) and decoding, swscale can produce a different palette that cannot be saved on container level, I sent a patch once as poc:
http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/138898

FFmpeg does not warn that the palette is not saved in mov.

comment:2 Changed 4 years ago by cehoyos

  • Keywords pal8 added; palette removed
Note: See TracTickets for help on using tickets.