Convert TS to Y4M — Free Online Tool

Convert MPEG-2 Transport Stream (.ts) files to YUV4MPEG2 (.y4m) format by decoding the compressed video stream — typically H.264 or H.265 — into fully uncompressed raw YUV frames. This is the standard preparation step before feeding broadcast or streaming video into lossless processing pipelines and tools like x264, x265, or VapourSynth.

FFmpeg Command

Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg

Free — no uploads, no signups. Your files never leave your browser.

Estimated output:

Conversion Complete!

Download

How It Works

TS files encapsulate compressed video (most commonly H.264/AVC or H.265/HEVC) and audio (often AAC or AC3) in a packetized container designed for broadcast transmission. Converting to Y4M requires fully decoding every compressed video frame from the transport stream into raw YUV pixel data — this is a full re-decode, not a remux. The resulting Y4M file stores each frame as uncompressed YUV4MPEG2 data with a plain-text header per frame describing resolution, frame rate, and colorspace. Audio is discarded entirely, since Y4M supports only raw video. The output file will be dramatically larger than the input because all compression is removed — a 1-minute 1080p H.264 TS file of ~150MB can expand to 10GB or more as Y4M.

What Each Flag Does

Flag What it does
ffmpeg Invokes the FFmpeg command-line tool, which handles the full pipeline of demuxing the TS container, decoding the compressed video elementary stream (H.264, H.265, etc.), and writing raw uncompressed frames to the Y4M output.
-i input.ts Specifies the MPEG-2 Transport Stream source file. FFmpeg will parse the TS packet structure, locate the video program elementary stream via the PMT, and begin decoding compressed video frames from it.
-c:v rawvideo Instructs FFmpeg to encode the output video stream using the rawvideo codec — meaning decoded YUV frames are written directly to the Y4M file with no recompression applied. This is what produces the fully uncompressed output.
output.y4m The destination YUV4MPEG2 file. The .y4m extension causes FFmpeg to automatically apply the yuv4mpegpipe muxer, which writes the Y4M file header (encoding resolution, frame rate, and colorspace) followed by individual FRAME headers and raw pixel data for each decoded frame.

Common Use Cases

  • Feeding broadcast-captured TS footage into a lossless re-encoding pipeline with x264 or x265 via stdin piping, avoiding any intermediate quality loss from transcoding through a lossy intermediate format
  • Providing uncompressed frame data to video quality analysis tools like VMAF, SSIM, or PSNR calculators that require raw YUV input to compare a broadcast source against an encoded output
  • Importing transport stream video into VapourSynth or AviSynth filter scripts that consume Y4M via pipe for frame-accurate filtering and processing
  • Stripping the broadcast container and compression from a recorded IPTV or DVB stream to obtain the raw video frames for forensic frame inspection or manual frame extraction
  • Preparing TS-captured content for lossless video editing in tools that accept Y4M input, ensuring no additional generation loss is introduced beyond the original capture
  • Decoding a compressed MPEG-2 TS recording to uncompressed Y4M as a baseline reference when benchmarking the quality and performance of different video encoders

Frequently Asked Questions

TS files store video in a compressed codec like H.264 or H.265, which achieves typical compression ratios of 100:1 or more compared to raw video. Y4M stores every frame as completely uncompressed YUV pixel data with no inter-frame prediction or entropy coding. A single uncompressed 1080p frame at 4:2:0 occupies roughly 3MB of data, so even a short clip produces a massive file. This is expected and intentional — the entire purpose of Y4M is lossless raw access to frame data.
The decode from H.264 or H.265 in the TS container to raw YUV frames is mathematically lossless — you get back exactly the pixel values the encoder produced. No additional quality is lost during the TS-to-Y4M conversion itself. However, any quality loss introduced by the original broadcast encoding (quantization artifacts, compression noise) is already baked into the source TS file and will be visible in the uncompressed Y4M output. Y4M faithfully preserves whatever the decoder produces.
Both are discarded. Y4M is a video-only format with no support for audio tracks, subtitle streams, or metadata of any kind. The TS container may carry multiple audio tracks (AAC, AC3, MP3), DVB subtitles, and teletext data — none of this survives in the Y4M output. If you need to preserve audio alongside the raw video, you would need to extract it separately from the source TS file in a parallel FFmpeg command.
By default, FFmpeg will decode the TS video stream and write Y4M frames in the same pixel format the codec outputs, typically yuv420p for standard H.264 and H.265 broadcast content. The Y4M header encodes the colorspace tag (e.g., C420) so downstream tools know how to interpret the data. If your source TS uses a higher bit depth (such as 10-bit HEVC from an HDTV recording), FFmpeg will carry that through to the Y4M output as long as rawvideo supports it.
Replace the output filename with a pipe character and specify the format explicitly: ffmpeg -i input.ts -c:v rawvideo -f yuv4mpegpipe pipe:1 | your-tool-here. The -f yuv4mpegpipe flag tells FFmpeg to write Y4M-formatted data to stdout rather than a named file, and the receiving tool reads it from stdin. This is the canonical workflow for tools like x264 (--demuxer y4m -), x265 (--y4m -), or VapourSynth scripts.
Yes. On Linux or macOS, you can loop over files in bash: for f in *.ts; do ffmpeg -i "$f" -c:v rawvideo "${f%.ts}.y4m"; done. On Windows PowerShell: Get-ChildItem *.ts | ForEach-Object { ffmpeg -i $_.FullName -c:v rawvideo ($_.BaseName + '.y4m') }. Be aware that batch converting multiple TS files to Y4M can consume enormous disk space quickly due to the uncompressed output size, so ensure you have sufficient storage before running a batch job.

Technical Notes

The rawvideo codec in FFmpeg acts as a passthrough for decoded pixel data — it applies no compression whatsoever, making Y4M output a direct representation of what the TS video decoder produces. Because TS uses packetized elementary streams (PES), FFmpeg must first parse the Program Association Table (PAT) and Program Map Table (PMT) to locate the video elementary stream before decoding begins; for malformed or truncated broadcast captures, this can occasionally cause startup delays or errors. Y4M's frame headers (FRAME\n per frame) make it straightforward for tools to seek and process frame-by-frame, but the format has no concept of keyframes, B-frames, or temporal compression — every frame is fully independent. Chroma subsampling from the source (4:2:0 in most broadcast H.264/H.265) is preserved in the Y4M output. One important limitation: Y4M files larger than 4GB cannot be represented correctly on FAT32 filesystems, so ensure your output destination uses NTFS, ext4, APFS, or another large-file-capable filesystem. Metadata such as broadcast timestamps, service names, and program IDs present in the TS container are not carried into Y4M.

Related Tools