[Ffmpeg-devel] [PATCH] - Apple QuickTime Pro "MSRLE" .avi files

Michael Niedermayer michaelni
Thu Feb 22 02:45:20 CET 2007


On Wed, Feb 21, 2007 at 04:20:12AM +0200, emild at cs.technion.ac.il wrote:
> Good moring everyone,
> .avi files produced by Apple QuickTime Pro when using the "BMP" encoding with
> 256 or 16 colors do not work with ffmpeg and mplayer. The problem is that Apple
> QuickTime Pro sets the fourCC of these files to 'RLE ', and the biCompression
> field of the BITMAPINFOHEADER is always set to BI_RLE8 (no matter whether 256
> or 16 colors are used). However, the frames themselves are not really encoded
> using RLE, but are ordinary palette-based bitmaps. I will upload some samples
> to the APPLE_MSRLE directory.
> QuickTime plays these files without problems. Windows Media player plays the 256
>  color version without problems, but fails to play the 16 color version.
> ffmpeg/ffplay/mplayer fail to read any of these files.
> I have made a patch which allows ffmpeg to read these files. I have attached it
> to this message.
> The problem is that Apple-style "MSRLE" files are hard to tell from "true" 
> MSRLE encoded files such as the infamous "clock.avi" found in every Windows
> installation. I distinguish between true MSRLE files and "Apple" [non-]MSRLE
> files by checking whether the size of the frame is equal to the expected size
> of the uncompressed bitmap. If it is, I assume that the frame is not compressed
> with RLE8/RLE4, and we are working with uncompressed frames a la Apple. I think
> that patching the msrle decoder is the easiest solution to the problem.
> Patching the avi reader, while probably more "correct" in a certain way is not
> fun, because I need to read at least one frame inside avi_read_header(), so
> that I can figure out what kind of "RLE " file we are really talking about.
> If you have questions, don't hesitate to ask.

the patch as it is, is a very dirty hack, it simply duplictaes the raw decoder
in msrle.c this is unacceptable, even more so considering that this is a clear
bug on the apple side and that the files are not something you would find
in the wild, raw in avi generated by QuackTome

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070222/b1cb3438/attachment.pgp>

More information about the ffmpeg-devel mailing list