Convert Y4M to RM — Free Online Tool
Convert Y4M (YUV4MPEG2) uncompressed video files to RealMedia (.rm) format using MJPEG video encoding and AAC audio — compressing raw YUV frame data into a streaming-oriented legacy container. This tool is ideal for archivists and developers working with uncompressed video pipelines who need to produce RM output compatible with classic RealPlayer environments.
to
FFmpeg Command
Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg
Drop your Y4M file here
or click to browse
Free — no uploads, no signups. Your files never leave your browser.
Settings
Note: Browser-based encoding uses approximate quality targets. For precise CRF compression, copy the FFmpeg command above and run it on your desktop.
Estimated output:
Conversion Complete!
DownloadHow It Works
Y4M files store raw, uncompressed YUV video frames with no inter-frame compression — every frame is a full image. During conversion to RM, each frame is independently encoded as a MJPEG image (Motion JPEG), which compresses each frame as a discrete JPEG with no temporal prediction between frames. Since Y4M files typically contain no audio track, the AAC audio stream in the output will either be silent or omitted depending on the source. The resulting RealMedia container wraps the MJPEG video stream in RealNetworks' proprietary format, which was designed for HTTP and RTSP streaming in the late 1990s and early 2000s. Because Y4M is lossless and uncompressed, expect a dramatic file size reduction — MJPEG introduces lossy compression at the frame level, and quality is controlled by the JPEG quantization scale.
What Each Flag Does
| Flag | What it does |
|---|---|
ffmpeg
|
Invokes the FFmpeg command-line tool, which handles all reading, encoding, and muxing for this Y4M to RM conversion entirely within your local environment (or via WebAssembly in the browser). |
-i input.y4m
|
Specifies the input Y4M file containing raw, uncompressed YUV video frames. FFmpeg detects the YUV4MPEG2 format automatically from the file header and decodes each frame as rawvideo with no decompression overhead. |
-c:v mjpeg
|
Encodes the video stream using Motion JPEG, which compresses each Y4M frame independently as a JPEG image. This is the video codec used by the RM container in this conversion and introduces lossy compression for the first time in the pipeline, since Y4M is uncompressed. |
-c:a aac
|
Sets the audio codec to AAC (Advanced Audio Coding) for the RM output. Since Y4M contains no audio, this flag has no effect on the output in practice, but is included to handle cases where an audio stream might be present in the source. |
-q:v 5
|
Controls the MJPEG compression quality on a scale of 1 (highest quality, largest file) to 10 (lowest quality, smallest file). A value of 5 provides a balanced tradeoff between visual fidelity and file size when compressing the raw YUV frames from the Y4M source. |
-b:a 128k
|
Sets the AAC audio bitrate to 128 kilobits per second, which is a standard quality level for stereo audio. This parameter is effectively unused in conversions from Y4M since Y4M carries no audio track. |
output.rm
|
Specifies the output filename and triggers FFmpeg to mux the MJPEG video (and any audio) into the RealMedia container format, the proprietary streaming format developed by RealNetworks that was dominant for internet video delivery in the late 1990s. |
Common Use Cases
- Archiving raw YUV video output from video synthesis tools or test pattern generators into a compact legacy format for long-term storage in RealMedia collections
- Producing RM files from uncompressed Y4M footage for playback in retro computing environments or vintage media players that only support RealMedia
- Converting the output of FFmpeg pipe-based video processing workflows (which commonly use Y4M as an intermediate) into a distributable RM file for legacy streaming servers
- Generating MJPEG-encoded video in an RM wrapper from raw YUV source material for frame-accurate review, since MJPEG's intra-frame-only compression allows easy random access to individual frames
- Compressing large uncompressed Y4M files from scientific or broadcast video capture into a significantly smaller RealMedia format for bandwidth-constrained archival transfer
- Demonstrating or testing a complete video encoding pipeline from raw uncompressed YUV input to a historically significant streaming container format
Frequently Asked Questions
Y4M stores every video frame as raw, uncompressed YUV pixel data — a single second of 1080p at 24fps can exceed 1GB. MJPEG, used in the RM output, compresses each frame independently as a JPEG image, removing spatial redundancy within each frame. The default quality setting (-q:v 5) achieves a substantial compression ratio while retaining reasonable visual fidelity, making the size difference between a Y4M source and RM output extremely large by design.
Y4M (YUV4MPEG2) is a video-only format — it carries no audio stream whatsoever. Because there is no audio in the source, the output RM file will not contain a meaningful audio track either, despite the FFmpeg command including -c:a aac and -b:a 128k flags. FFmpeg may produce a silent or empty audio stream, or omit it depending on the source content. If you need audio in the RM output, you would need to supply a separate audio source using FFmpeg's multiple-input syntax.
The -q:v parameter controls the JPEG quantization scale applied to each frame during MJPEG encoding. Lower values (closer to 1) produce higher quality with larger file sizes, while higher values (up to 10) produce more compression artifacts with smaller files. The default of 5 is a balanced midpoint. To increase quality, change -q:v 5 to -q:v 2 in the FFmpeg command; to prioritize smaller file size, use -q:v 8 or higher. Note that MJPEG is always lossy regardless of quality setting.
RealMedia (.rm) is a legacy proprietary format with limited support in modern software. VLC Media Player is the most reliable modern option for RM playback and supports both the container and MJPEG video codec. Most other contemporary players — including Windows Media Player on modern Windows, QuickTime, and browser-based players — will not open RM files without additional plugins or codec packs. The format was primarily designed for RealPlayer, which is largely obsolete today.
You can batch process multiple Y4M files using a shell loop around the displayed FFmpeg command. On Linux or macOS, run: for f in *.y4m; do ffmpeg -i "$f" -c:v mjpeg -c:a aac -q:v 5 -b:a 128k "${f%.y4m}.rm"; done. On Windows Command Prompt, use: for %f in (*.y4m) do ffmpeg -i "%f" -c:v mjpeg -c:a aac -q:v 5 -b:a 128k "%~nf.rm". Each Y4M file will be converted to a corresponding RM file with the same base name.
Yes — this conversion is inherently lossy. Y4M is a lossless, uncompressed format that preserves every pixel value exactly, while MJPEG (used in the RM output) applies lossy JPEG compression to each frame. Once converted to RM, you cannot recover the original uncompressed pixel data. If you need to preserve a lossless master copy, always retain the original Y4M file and treat the RM output as a delivery or archive copy only.
Technical Notes
Y4M encodes video as sequential raw YUV frames with a plain-text header per frame, making it trivially parseable but extremely large — it is almost exclusively used as a pipe intermediate between tools like x264, x265, VapourSynth, or AviSynth rather than as a storage format. When FFmpeg reads a Y4M file, it decodes the rawvideo stream directly with no decompression step. The MJPEG encoder then compresses each frame independently using discrete cosine transform (DCT) based JPEG compression, identical to how still JPEG images are encoded. This intra-frame-only approach means no B-frames or P-frames exist in the output — every frame in the RM file is a keyframe, which makes the output suitable for frame-accurate editing or scrubbing but inefficient compared to inter-frame codecs like H.264. The RealMedia container does not support transparency, subtitles, chapters, or multiple audio tracks, so none of Y4M's pipeline metadata is carried forward. Because Y4M files have no audio, the -b:a 128k AAC setting in the command is effectively inert unless an audio stream is somehow present. File sizes will vary significantly based on the -q:v value: a quality of 1 approaches visually lossless MJPEG while a quality of 10 produces visible blocking artifacts similar to heavily compressed JPEG images.