Convert MTS to Y4M — Free Online Tool
Convert MTS camcorder footage (AVCHD with H.264 video and AC-3/AAC audio) to Y4M (YUV4MPEG2), an uncompressed raw video format ideal for lossless intermediate processing and piping into tools like x264, x265, or video analysis software. The H.264 stream is fully decoded to raw YUV pixel data, giving you a pristine, uncompressed frame sequence with zero generational quality loss.
to
FFmpeg Command
Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg
Drop your MTS 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
MTS files store H.264-encoded video inside an MPEG-2 Transport Stream container, a format designed for broadcast and camcorder recording that uses aggressive lossy compression to keep file sizes manageable. Converting to Y4M reverses the entire H.264 compression process: FFmpeg fully decodes every compressed frame, reconstructing the raw YUV luminance and chrominance pixel data, and writes it into the YUV4MPEG2 container without applying any new compression. The result is a completely uncompressed video file where every frame is stored as-is. Audio is dropped entirely because Y4M has no audio track support — the format is video-only by design. The output file will be dramatically larger than the source MTS, often 20–50x, because the space savings of H.264 compression are removed.
What Each Flag Does
| Flag | What it does |
|---|---|
ffmpeg
|
Invokes the FFmpeg application. In this browser tool, FFmpeg runs as a WebAssembly binary (FFmpeg.wasm) entirely within your browser — no server is involved. On your desktop, this calls your locally installed FFmpeg executable. |
-i input.mts
|
Specifies the input MTS file — an AVCHD MPEG-2 Transport Stream container holding H.264 video and AC-3 or AAC audio as recorded by Sony or Panasonic camcorders. FFmpeg automatically detects the transport stream structure and demuxes the H.264 video stream for decoding. |
-c:v rawvideo
|
Instructs FFmpeg to encode the output video as raw, uncompressed pixel data rather than applying any compression codec. This fully decodes the H.264 frames from the MTS source and writes each frame's YUV pixel values verbatim into the Y4M container, with no encoding step and no quality loss beyond what was already present in the compressed source. |
output.y4m
|
Sets the output filename with the .y4m extension, which FFmpeg recognizes as the YUV4MPEG2 format and automatically writes the required plaintext Y4M header (containing resolution, frame rate, interlacing, and colorspace information) followed by the raw uncompressed frame data. The resulting file is suitable for direct piping into encoders like x264, x265, or video analysis tools. |
Common Use Cases
- Feeding camcorder footage into a lossless video encoding pipeline — for example, piping Y4M output directly into a standalone x265 encoder to re-encode AVCHD footage with precise custom settings unavailable through FFmpeg's libx265 wrapper.
- Performing frame-accurate video analysis or quality metrics (e.g., VMAF, PSNR, SSIM scoring) on raw MTS footage without introducing any decoding artifacts that might skew measurements.
- Importing AVCHD camcorder clips into video compositing or scientific tools like Blender's Video Sequence Editor or ImageMagick pipelines that accept raw YUV4MPEG2 input but cannot decode H.264 transport streams directly.
- Archiving a lossless decoded snapshot of specific MTS clips before performing destructive edits, ensuring the original decoded pixel data can always be recovered without re-decoding the original H.264 source.
- Using Y4M as an intermediate step when transcoding MTS footage through an application chain that requires a common uncompressed handoff format between encoding stages, avoiding cumulative lossy re-compression.
- Extracting individual frames from AVCHD camcorder video for computer vision or machine learning dataset preparation, where downstream tools expect raw uncompressed YUV input rather than a compressed stream.
Frequently Asked Questions
MTS files use H.264 compression, which is a highly efficient lossy codec that can reduce video data by 50–100x compared to raw pixel storage. Y4M stores every video frame as uncompressed YUV pixel data with no compression whatsoever. A 1-minute MTS clip that might be 200MB can easily become 4–10GB as a Y4M file. This is expected and is the entire point of Y4M — it is an intermediate format for processing pipelines, not for storage or distribution.
No additional quality loss is introduced during this conversion. The H.264 video in your MTS file was already lossy-compressed when recorded by your camcorder, and that compression cannot be reversed. However, the conversion from MTS to Y4M simply decodes the H.264 stream to its raw pixel representation without adding any new encoding step, so the Y4M file is a pixel-perfect lossless representation of what your MTS file contained. Any imperfections visible in the Y4M were already present in the compressed source.
The audio is discarded entirely. Y4M (YUV4MPEG2) is a video-only format with no provision for audio tracks — it has no audio container structure at all. Your MTS file's AC-3 or AAC audio streams are simply not written to the output. If you need the audio preserved alongside the decoded video, you would need to extract it separately using FFmpeg into a file like WAV or FLAC before or after the Y4M conversion.
Yes, and this is one of Y4M's primary intended use cases. On your desktop, you can modify the FFmpeg command to write to stdout and pipe it into another tool: ffmpeg -i input.mts -c:v rawvideo -f yuv4mpegpipe - | x265 --y4m - --output output.265. The Y4M header that FFmpeg writes contains frame rate, resolution, and colorspace metadata that receiving encoders like x264 and x265 parse automatically, making it a reliable interchange format for pipeline chaining.
You can add a -pix_fmt flag to control the output color format. For example, ffmpeg -i input.mts -c:v rawvideo -pix_fmt yuv420p output.y4m keeps the standard 4:2:0 chroma subsampling that AVCHD cameras record in, while -pix_fmt yuv444p would upsample to full 4:4:4 chroma. Without specifying -pix_fmt, FFmpeg preserves the native colorspace from the MTS source, which for AVCHD is typically yuv420p. Some downstream tools require a specific pixel format, so check your application's requirements before choosing.
The command shown processes one file at a time, but you can adapt it for batch processing on your desktop using a shell loop. On Linux or macOS: for f in *.mts; do ffmpeg -i "$f" -c:v rawvideo "${f%.mts}.y4m"; done. On Windows Command Prompt: for %f in (*.mts) do ffmpeg -i "%f" -c:v rawvideo "%~nf.y4m". Keep in mind that Y4M files are extremely large, so ensure you have sufficient disk space — batch converting even a few minutes of AVCHD footage can consume hundreds of gigabytes.
Technical Notes
Y4M (YUV4MPEG2) is defined by a simple plaintext header followed by raw interleaved frame data, making it one of the most straightforward uncompressed video formats to parse and generate. When decoding MTS/AVCHD sources, the native pixel format is almost always yuv420p (4:2:0 chroma subsampling at 8 bits per channel), which FFmpeg preserves by default in the Y4M output. AVCHD recordings commonly use BT.709 colorspace for HD content, but Y4M's colorspace metadata support is limited — downstream tools may or may not correctly interpret the colorimetry tags FFmpeg embeds in the Y4M header, so manual colorspace specification may be needed in professional workflows. Subtitles, chapters, and multiple audio tracks present in the MTS source are all silently dropped since Y4M supports none of these. Frame rate and resolution metadata from the AVCHD stream are correctly passed through and written into the Y4M header. Because AVCHD uses variable-bitrate H.264 with B-frames, FFmpeg must buffer and reorder frames during decoding before writing sequential Y4M output, so the conversion is not instantaneous even though the output codec is 'rawvideo'. Files over 1GB are best processed using the desktop FFmpeg command rather than this browser tool, which is especially relevant here given that Y4M output routinely exceeds 10GB for even short clips.