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

emild at cs.technion.ac.il emild
Wed Feb 21 03:20:12 CET 2007


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.

                                                    Regards,
                                                              Emil
-------------- next part --------------
A non-text attachment was scrubbed...
Name: apple_msrle.diff
Type: text/x-patch
Size: 2964 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070221/83252ea8/attachment.bin>



More information about the ffmpeg-devel mailing list