Convert Y4M to J2B — Free Online Tool
Convert Y4M (YUV4MPEG2) uncompressed video files to J2B audio format, extracting and encoding the audio stream using the LAME MP3 encoder at 128k bitrate. This tool runs entirely in your browser via FFmpeg.wasm — no uploads, no servers, completely private.
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 is a raw, uncompressed video container used as an intermediate format in video processing pipelines — it carries rawvideo frames and, when present, an accompanying audio stream. During this conversion, FFmpeg discards the raw video frames entirely and targets only the audio stream, encoding it into MP3 using the libmp3lame encoder at 128k bitrate. The resulting J2B file wraps this MP3 audio in the ASYLUM Music Format header structure used by Jazz Jackrabbit 2. Because Y4M is uncompressed, no video decoding overhead is introduced — FFmpeg reads the audio data directly and passes it through the LAME encoder in a single pass.
What Each Flag Does
| Flag | What it does |
|---|---|
ffmpeg
|
Invokes the FFmpeg binary — in the browser this runs as FFmpeg.wasm compiled to WebAssembly, executing the same logic as the desktop version without any server involvement. |
-i input.y4m
|
Specifies the input Y4M file. FFmpeg's YUV4MPEG2 demuxer reads the raw uncompressed video frames and any embedded audio stream from this file, making both available for processing or discarding. |
-c:a libmp3lame
|
Selects the LAME MP3 encoder for the audio stream, converting whatever uncompressed PCM audio is present in the Y4M source into lossy MPEG Layer 3 audio — the format required for J2B output. |
-b:a 128k
|
Sets the MP3 audio bitrate to 128 kilobits per second. This is the default quality setting for J2B output, balancing file size and audio fidelity at a level appropriate for game music use cases. |
output.j2b
|
Defines the output filename with the .j2b extension, instructing FFmpeg to use the J2B muxer which wraps the encoded MP3 audio in the ASYLUM Music Format header structure associated with Jazz Jackrabbit 2 game files. |
Common Use Cases
- Extracting audio from a Y4M intermediate file produced by a video processing pipeline (e.g., from tools like AviSynth or VapourSynth) to supply custom music for Jazz Jackrabbit 2 mods or level editors
- Converting a lossless uncompressed audio track embedded in a Y4M capture file into a J2B-compatible MP3 for use with JJ2 community fan patches or level packs
- Preparing test audio content in a universally readable uncompressed format (Y4M) and outputting it as J2B to verify game audio compatibility during modding workflows
- Archiving or sharing background music from Y4M source files in the J2B format recognized by Jazz Jackrabbit 2 game engines and community tools like JJ2+
- Batch-converting a series of Y4M render outputs from a motion graphics pipeline into J2B files to supply a set of in-game music tracks for a custom JJ2 episode
Frequently Asked Questions
Not always. Y4M (YUV4MPEG2) is primarily a raw video format and many Y4M files contain no audio whatsoever, since the format is most commonly used as a video-only intermediate in piping workflows between tools like FFmpeg, x264, or VapourSynth. If your Y4M file has no audio stream, FFmpeg will produce an empty or invalid J2B output. You should verify your source file contains audio before attempting this conversion.
The default conversion uses libmp3lame at 128k bitrate, which is a lossy encoding — some audio quality is permanently lost compared to the original uncompressed source in the Y4M file. For game audio in Jazz Jackrabbit 2, 128k MP3 is generally adequate and produces small file sizes, but if your source audio is high fidelity and you want better quality, you can modify the FFmpeg command to use -b:a 192k or -b:a 320k before outputting. Once encoded to MP3 at a given bitrate, the quality cannot be recovered.
J2B is a niche format tied specifically to Jazz Jackrabbit 2 and is based on the ASYLUM Music Format with a custom header. While FFmpeg can write files with the .j2b extension using MP3 audio via libmp3lame, the resulting file's header structure may not fully conform to what the JJ2 game engine or tools like JJ2+ expect. You may need to use a dedicated JJ2 modding tool to repackage the MP3 into a properly structured J2B file if direct playback in-game is the goal.
In the command 'ffmpeg -i input.y4m -c:a libmp3lame -b:a 128k output.j2b', replace '128k' with your desired bitrate — for example, '-b:a 320k' for the highest MP3 quality or '-b:a 64k' for a smaller file size. Higher bitrates produce better audio fidelity but larger files, while lower bitrates reduce file size at the cost of audio quality. Since Y4M source audio is uncompressed and lossless, using a higher bitrate like 256k or 320k is recommended if audio quality matters.
The browser-based tool processes one file at a time, but you can run the equivalent command locally on your desktop for batch processing. On Linux or macOS, use a shell loop: 'for f in *.y4m; do ffmpeg -i "$f" -c:a libmp3lame -b:a 128k "${f%.y4m}.j2b"; done'. On Windows PowerShell, iterate over files similarly using Get-ChildItem. This is especially useful for files over 1GB, which exceed the browser tool's processing limit.
Y4M stores raw, uncompressed video frames — even a few seconds of video can occupy hundreds of megabytes or several gigabytes because no compression is applied. The J2B output contains only the audio stream encoded as MP3 at 128k bitrate, which is both lossy and highly compressed. The dramatic size reduction is expected: you are discarding all video data and compressing the audio from uncompressed PCM to MP3, which typically achieves 10:1 or greater compression ratios on audio alone.
Technical Notes
Y4M files carry rawvideo streams and optionally an interleaved audio stream, though audio support in Y4M is inconsistently implemented across tools — some encoders write audio into Y4M while others strip it entirely. FFmpeg's Y4M demuxer will expose an audio stream if one is present, passing it to the libmp3lame encoder for J2B output. The libmp3lame encoder used here is the gold-standard open-source LAME MP3 implementation, producing standard MPEG Layer 3 audio fully compatible with virtually any decoder. J2B as a format is extremely niche — it is not a general-purpose audio container but a game-specific format tied to Jazz Jackrabbit 2's engine, and FFmpeg's muxer support for it may not produce a file with the exact binary header structure that JJ2 or its community tools (JJ2+, Diamondus) require for in-game playback. No metadata from the Y4M source (such as frame rate, resolution, or colorspace markers) is carried over into the J2B output, since J2B is audio-only. There is no subtitle, chapter, or multiple audio track support in either format.