[Ffmpeg-devel] [PATCH] - Error handling in MSRLE

emild at cs.technion.ac.il emild
Wed Feb 21 04:27:08 CET 2007


Hello,

ffmpeg complains when reading a legal .avi file encoded with MSRLE (such as
"clock.avi" found in the Windows directory of every installation of the Windows
OS), saying essentially that the frame is 2 bytes longer than how much it should
be. The reason why this happens  is that the decoder does not read the "end of
bitmap" marker 0x00, 0x01 because the decoding loop stops when all the lines
have been decoded.

The attached patch fixes the bug. The error message will be displayed only if
the last bytes are not a valid end-of bitmap marker. After applying this patch,
ffmpeg should no longer complain as described below.

                                                         Regards,
                                                                 Emil





$ ./ffmpeg_g -i /mnt/win_c/WINNT/clock.avi -vcodec h263 -an -r 15 -b 64 -s
176x144 ~/xx_out.3gp
FFmpeg version SVN-r8033, Copyright (c) 2000-2007 Fabrice Bellard, et al.
  configuration: 
  libavutil version: 49.3.0
  libavcodec version: 51.33.0
  libavformat version: 51.10.0
  built on Feb 21 2007 03:41:56, gcc: 4.1.1 20070105 (Red Hat 4.1.1-51)
Input #0, avi, from '/mnt/win_c/WINNT/clock.avi':
  Duration: 00:00:12.0, start: 0.000000, bitrate: 55 kb/s
  Stream #0.0: Video: msrle, pal8, 321x321,  1.00 fps(r)
  Stream #0.1: Audio: truespeech, 8000 Hz, mono, 8 kb/s
File '/home/emil/xx_out.3gp' already exists. Overwrite ? [y/N] y
PIX_FMT_YUV420P will be used as an intermediate format for rescaling
Output #0, 3gp, to '/home/emil/xx_out.3gp':
  Stream #0.0: Video: h263, yuv420p, 176x144, q=2-31, 0 kb/s, 15.00 fps(c)
Stream mapping:
  Stream #0.0 -> #0.0
Press [q] to stop encoding
[msrle @ 0x846285c] MS RLE: ended frame decode with bytes left over (5186 <
5188)
[msrle @ 0x846285c] MS RLE: ended frame decode with bytes left over (5242 <
5244)
[msrle @ 0x846285c] MS RLE: ended frame decode with bytes left over (5020 <
5022)
[msrle @ 0x846285c] MS RLE: ended frame decode with bytes left over (5388 <
5390)
[msrle @ 0x846285c] MS RLE: ended frame decode with bytes left over (5370 <
5372)
[msrle @ 0x846285c] MS RLE: ended frame decode with bytes left over (5566 <
5568)
[msrle @ 0x846285c] MS RLE: ended frame decode with bytes left over (5144 <
5146)
[msrle @ 0x846285c] MS RLE: ended frame decode with bytes left over (5378 <
5380)
[msrle @ 0x846285c] MS RLE: ended frame decode with bytes left over (5204 <
5206)
[msrle @ 0x846285c] MS RLE: ended frame decode with bytes left over (5980 <
5982)
[msrle @ 0x846285c] MS RLE: ended frame decode with bytes left over (5818 <
5820)
[msrle @ 0x846285c] MS RLE: ended frame decode with bytes left over (6010 <
6012)
frame=  165 q=31.0 Lsize=      36kB time=11.0 bitrate=  27.0kbits/s    
video:7kB audio:0kB global headers:0kB muxing overhead 402.466793%

$
-------------- next part --------------
A non-text attachment was scrubbed...
Name: msrle_error.diff
Type: text/x-patch
Size: 1078 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070221/c6e78a2f/attachment.bin>



More information about the ffmpeg-devel mailing list