Convert M2TS to Y4M — Free Online Tool
Convert M2TS Blu-ray and AVCHD video files to Y4M (YUV4MPEG2) uncompressed format directly in your browser. This conversion decodes the H.264 or H.265 video stream from the M2TS transport stream container into raw, pixel-perfect YUV frames — ideal for lossless video processing pipelines and frame-accurate editing tools.
to
FFmpeg Command
Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg
Drop your M2TS 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
M2TS is a MPEG-2 Transport Stream container typically holding compressed H.264 (AVC) or H.265 (HEVC) video alongside multi-channel audio tracks. During this conversion, FFmpeg fully decodes the compressed video stream frame by frame into raw YUV pixel data and writes it into the Y4M container using the rawvideo codec. Y4M is essentially a header plus a flat sequence of uncompressed YUV frames — no inter-frame compression, no motion vectors, no codec artifacts. The audio tracks are discarded entirely because Y4M does not support audio. The resulting file will be dramatically larger than the source M2TS, since all compression is stripped away, but every frame is a mathematically exact representation of the decoded Blu-ray or AVCHD video.
What Each Flag Does
| Flag | What it does |
|---|---|
ffmpeg
|
Invokes the FFmpeg binary — the open-source multimedia processing engine that handles all demuxing, decoding, and encoding. In this browser-based tool, FFmpeg runs as a WebAssembly module (FFmpeg.wasm) so no files leave your device. |
-i input.m2ts
|
Specifies the input file as an M2TS Blu-ray or AVCHD transport stream. FFmpeg automatically detects the container format and identifies the contained video stream (typically H.264 or H.265) along with any audio and subtitle tracks. |
-c:v rawvideo
|
Instructs FFmpeg to encode the output video using the rawvideo codec, which means fully decoded, uncompressed YUV frames are written directly to the output with no re-compression. This is the only video codec compatible with the Y4M container. |
output.y4m
|
Sets the output filename with the .y4m extension, which FFmpeg uses to automatically select the YUV4MPEG2 muxer. The resulting file will contain a Y4M header followed by sequential raw YUV frames decoded from the M2TS source — no audio, no chapters, no subtitles. |
Common Use Cases
- Feed decoded Blu-ray footage into frame-accurate video analysis tools like VirtualDub2, Avisynth, or VapourSynth that require uncompressed Y4M input
- Use as an intermediate step when encoding Blu-ray source material through a custom FFmpeg pipe, such as piping Y4M frames into x264 or x265 with hand-tuned settings not possible in a single command
- Perform lossless frame extraction and quality comparison studies on H.264/H.265 Blu-ray encodes by diffing decoded Y4M frames against a reference
- Prepare M2TS footage from AVCHD camcorders for import into professional grading tools or scientific imaging software that only accepts uncompressed YUV streams
- Strip the transport stream overhead and codec layer from M2TS recordings to obtain raw frames for machine learning training datasets or video codec research
- Use as a diagnostic step to verify the decoded picture output of a Blu-ray rip before re-encoding, ensuring no decoder-level corruption exists in the source
Frequently Asked Questions
M2TS stores video compressed with H.264 or H.265, which achieves compression ratios of 100:1 or more by discarding redundant information between frames. Y4M stores every frame as raw, uncompressed YUV pixel data with no inter-frame compression whatsoever. A single second of 1080p video at 24fps in Y4M can easily occupy several hundred megabytes, whereas the same second in an H.264 M2TS might be only a few megabytes. This size explosion is expected and is the entire point of the format — Y4M is an intermediate format, not a distribution format.
The Y4M output is a lossless representation of the decoded video, but not necessarily of the original camera capture. The M2TS source was already encoded with lossy H.264 or H.265 compression when it was authored to Blu-ray or recorded by an AVCHD camcorder — that compression loss happened earlier and cannot be undone. What Y4M guarantees is that every pixel in the decoded frames is captured exactly as FFmpeg decoded them, with no additional generation loss introduced by this conversion step.
Y4M (YUV4MPEG2) is a video-only format by design — it has no provision for audio streams in its specification. M2TS files from Blu-ray discs often carry Dolby TrueHD, DTS-HD Master Audio, or multi-track AAC audio, but none of these can be stored in a Y4M file. If you need to preserve the audio alongside the uncompressed video, Y4M is not the right output format. You would need to extract the audio separately from the M2TS using a different FFmpeg command.
FFmpeg will use the chroma subsampling of the decoded M2TS stream, which for Blu-ray H.264 and H.265 content is almost always 4:2:0. The Y4M header encodes the pixel format metadata, so downstream tools reading the Y4M file will know the correct subsampling. If your processing pipeline requires 4:4:4 or a specific bit depth, you would need to add pixel format conversion flags to the FFmpeg command before writing the Y4M output.
Yes. You can add time-based trimming flags to the command to extract a clip rather than converting the entire file. Insert '-ss 00:01:30' before the input to seek to 1 minute 30 seconds, and '-t 00:00:10' after the input to limit output to 10 seconds. For example: 'ffmpeg -ss 00:01:30 -i input.m2ts -t 00:00:10 -c:v rawvideo output.y4m'. This is especially useful when you only need a short clip from a long Blu-ray rip for analysis or testing purposes, and avoids generating a massive Y4M file from the full recording.
The command shown is for a single file, but you can adapt it for batch processing in a shell script on your local machine. On Linux or macOS, a simple loop like 'for f in *.m2ts; do ffmpeg -i "$f" -c:v rawvideo "${f%.m2ts}.y4m"; done' will process every M2TS file in the current directory. On Windows, a similar approach works in PowerShell. Because Y4M files are extremely large, ensure you have sufficient disk space before batching — a single 20GB Blu-ray rip could expand to hundreds of gigabytes in uncompressed Y4M form.
Technical Notes
M2TS uses the MPEG-2 Transport Stream multiplexing layer, which adds 4-byte timestamps and packet identifiers to carry multiple program streams simultaneously — a structure designed for broadcast and disc delivery. When FFmpeg demuxes an M2TS file, it parses the transport stream packets, identifies the primary video PID, and feeds the compressed NAL units (for H.264/H.265) into the appropriate decoder. The decoded output is then written directly as raw YUV frames into the Y4M container. Y4M's format is extremely simple: an ASCII file header declaring frame dimensions, frame rate, interlacing mode, and pixel format, followed by per-frame markers and raw planar YUV data. One important consideration is interlacing — many Blu-ray and AVCHD sources use interlaced video (1080i), and Y4M will preserve the interlaced field structure rather than deinterlacing automatically. If your downstream tool expects progressive frames, you will need to add a deinterlace filter such as '-vf yadif' to the command. Metadata such as chapter markers, subtitle tracks, and secondary audio tracks present in the M2TS file are all silently dropped, as Y4M supports none of these features. Color space metadata (BT.709 for HD content) is captured in the Y4M header where the format allows, but support varies between consuming applications.