Convert Video to Microsoft RLE Using FFmpeg
This article provides a step-by-step guide on how to transcode modern video files into the historical Microsoft RLE (Run-Length Encoding) format used in Windows 3.1 using FFmpeg. You will learn the exact command-line arguments required to format the video to 8-bit color and encode the audio into a compatible PCM format, ensuring the resulting AVI file can run on vintage operating systems.
Understanding Microsoft RLE constraints
Microsoft RLE (frequently identified by the FourCC code
MRLE or RLE) is an extremely old graphics and
video format. To successfully play a video in Windows 3.1 using the
classic Media Player (MPLAYER.EXE), the file must adhere to
strict limitations:
- Container: Must be AVI (
.avi). - Color Depth: Strictly 8-bit palettized color (256 colors).
- Audio: Uncompressed PCM audio, typically 8-bit or 16-bit, at low sample rates like 11025 Hz or 22050 Hz.
The FFmpeg Command
To transcode a modern video (such as an MP4) into a Windows 3.1-compatible AVI file with Microsoft RLE video and PCM audio, run the following command in your terminal:
ffmpeg -i input.mp4 -c:v msrle -pix_fmt pal8 -c:a pcm_s16le -ar 22050 -ac 1 output.aviCommand Breakdown
-i input.mp4: Specifies your source video file.-c:v msrle: Selects the Microsoft RLE video encoder.-pix_fmt pal8: Converts the video’s color space to 8-bit palettized color. This is a strict requirement; themsrleencoder will fail if you try to feed it standard 24-bit (YUV or RGB) color.-c:a pcm_s16le: Encodes the audio stream to 16-bit Little-Endian PCM, which is natively understood by early Windows audio drivers.-ar 22050: Lowers the audio sample rate to 22.05 kHz to match the hardware limitations of the Sound Blaster-era sound cards.-ac 1: Downmixes the audio to a single channel (mono) to save file space and processing power.output.avi: The output file. It must use the.aviextension.
Adjusting Video Resolution (Optional)
Windows 3.1 computers struggle to play high-resolution files. If your input video is 1080p or 4K, you must downscale it to a historical resolution like 320x240 or 160x120.
You can add the scale filter to your command like this:
ffmpeg -i input.mp4 -vf "scale=320:240" -c:v msrle -pix_fmt pal8 -c:a pcm_s16le -ar 11025 -ac 1 output.aviUsing this command ensures your output file is fully optimized for vintage hardware emulation or original retro PCs running Windows 3.1.