#1191 closed defect (fixed)
qt tiff enc: make output compatible with quitcktime
Reported by: | ami_stuff | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | undetermined |
Version: | git-master | Keywords: | mov tif |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
http://ffmpeg.org/trac/ffmpeg/raw-attachment/ticket/1167/j.asf
the output from
ffmpeg -i j.asf -an -vcodec tiff -pix_fmt (any) out.mov
is always identified by quicktime as 24bpp and is decoded incorrectly.
I have found out where is a problem, please look at the attached screenshot.
The left file is an unmodified output from:
ffmpeg -i j.asf -vcodec tiff -pix_fmt gray out.mov
conversion, the right file is modified by me (to values which are present in QT TIFF 256gray generated by QuickTime) and after this change the file is identified and decoded correctly by QuickTime.
(for monob 18 FF FF should be repleaced by 01 00 01)
Attachments (6)
Change History (17)
by , 13 years ago
Attachment: | qttiff.jpg added |
---|
comment:1 by , 13 years ago
comment:2 by , 13 years ago
Keywords: | mov tif added |
---|---|
Version: | unspecified → git-master |
Does it work with "28 FF FF"?
The relevant line in libavformat/movenc.c is 1064, "avio_wb16(pb, 0x18); /* Reserved */"
comment:3 by , 13 years ago
yes it seems enough to modify only this one value to number of bpp to make the file correctly recognized by qt
monob/w: 01
gray: 28
rgb: 18
rgba: 20
pal8: 08 (wrong palette/colors, probably unrelated issue)
by , 13 years ago
Attachment: | patchtiffmov.diff added |
---|
comment:4 by , 13 years ago
Status: | new → open |
---|
Could you test if attached patch fixes RGBA and monob?
Does it also work for RGB48 and RGBA64?
comment:5 by , 13 years ago
monob/w, rgb24 and rgba deocdes correctly with attached patch
pal8 have wrong colors (see pal8.bmp), maybe problem with endianness?
rgb48/64 is not supported by qt even in tiff
by , 13 years ago
by , 13 years ago
by , 13 years ago
Attachment: | patchpngtga.diff added |
---|
comment:6 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | open → closed |
tiff should be fixed as far as possible, could you test attached patch with png and targa?
comment:7 by , 13 years ago
targa:
qt decodes correctly all modes of targa except rgb555le, but when I add
case PIX_FMT_RGB555LE: + avctx->bits_per_coded_sample = 16; pkt->data[2] = TGA_RGB; /* uncompresses true-color image */ pkt->data[16] = 16; /* bpp */ break;
then I get correct output.
The problem is that avctx->bits_per_coded_sample is set to 15 for rgb555le mode:
avctx->bits_per_coded_sample = av_get_bits_per_pixel(&av_pix_fmt_descriptors[avctx->pix_fmt]); + av_log(avctx, AV_LOG_INFO, "bits_per_coded_sample: %d\n", avctx->bits_per_coded_sample); switch(avctx->pix_fmt) {
png:
qt decodec correctly monob/rgb24/rgba/gray/pal8 (wrong colors)
gray16/rgb48/rgba64 doesn't work (black screen)
comment:8 by , 13 years ago
Could you test ffmpeg -i input -vcodec png out.avi with WMP and different pix_fmts with and without this patch (if this works at all with -pix_fmt rgb24)?
http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/143645
comment:9 by , 13 years ago
I have installed CorePNG codec, so WMP is able to play output avi from this:
ffmpeg -i test.bmp -pix_fmt <format> -vtag PNG1 out.avi
and WMP plays correctly (with and without your patch) monob/gray/pal8/rgb24 and rgba.
VirtualDub is not so happy:
monob/gray/pal8 decodes incorrectly
rgb24/rgba: first frame decodes ok, next frames are upside-down
but this in unrealted to your patch, so in short your patch shouldn't break anything for at least CorePNG codec in AVI.
the same problem (and fix) for -vcodec png and targa