Chip in

Y4M file (YUV4MPEG2)

Uncompressed YUV4MPEG2, used for codec testing.

Last updated

Convert Y4M to MP4, free and without uploading it.

What is a Y4M file?

In short: A Y4M file (.y4m) is a video file in the Y4M format. Y4M is raw uncompressed video with a one-line text header saying the resolution, frame rate and colour layout, then every frame in full. It can be converted to MP4, MOV or GIF for free in a web browser with iHateFiles, without uploading it.

YUV4MPEG2, a simple wrapper used by the MPEG and Xiph tools for passing raw frames between programs.

Y4M is raw uncompressed video with a one-line text header saying the resolution, frame rate and colour layout, then every frame in full. It exists so codec developers can compare encoders on identical input, and it is enormous by design.

What Y4M is good at

  • Completely uncompressed, so nothing confounds a comparison
  • Trivial for a program to read or write
  • The standard input format for codec benchmarking

Where Y4M falls short

  • Gigabytes per minute
  • No audio
  • No player treats it as a normal video file

When to use Y4M

Convert Y4M to MP4 the moment you want to watch rather than measure.

How to open a Y4M file

FFmpeg, codec development tools, and VLC.

Opening a .y4m file on each platform
WindowsVLC, or any codec test tool. It is raw uncompressed frames, so a few seconds can run to gigabytes.
macOSVLC or mpv.
Linuxmpv, FFmpeg and every encoder development tool read it natively — this is where it belongs.
PhoneNot practical on a phone.
In a browserNo browser plays Y4M.

The thing that usually goes wrong

A few seconds of Y4M can be larger than a whole film in MP4. That is the format doing its job.

Inside a Y4M file

YUV4MPEG2 is not really a video format so much as an agreement about how to write raw frames to a pipe. Each file is a short plain-text header, then the word FRAME before every picture, then the uncompressed samples. You can read the header in a text editor.

It exists because codec developers need an input that has been through no encoder at all. If you are measuring whether AV1 beats VP9, any compression on the source contaminates the result. Y4M is the lossless, uncompressed common ground, which is why every encoder test harness and every FFmpeg pipeline uses it internally.

The consequence is size. A minute of 1080p at 30fps in 4:2:0 is roughly 5.5 GB, uncompressed and unapologetic. Y4M is a working format for a pipeline stage, never a delivery format, and converting one to anything else is nearly always the right move.

Y4M at a glance
Full nameYUV4MPEG2
HeaderPlain ASCII, beginning YUV4MPEG2
CompressionNone whatsoever
Chroma4:2:0, 4:2:2, 4:4:4, mono
AudioCannot carry any
Typical size~5.5 GB per minute at 1080p30 4:2:0

Not sure the file really is a Y4M? Identify it by its contents, whatever its extension says.

Questions

What is a Y4M file?

Y4M stands for YUV4MPEG2. Uncompressed YUV4MPEG2, used for codec testing. Files use the .y4m extension.

What does Y4M stand for?

Y4M stands for YUV4MPEG2.

How do I open a Y4M file?

On Windows: VLC, or any codec test tool. It is raw uncompressed frames, so a few seconds can run to gigabytes. On a Mac: VLC or mpv. On a phone: Not practical on a phone. Or convert a Y4M here to a format that opens everywhere, free and without uploading it.

Can I convert Y4M for free?

Yes. Every conversion here is free and unlimited, because your own device does the work rather than a server we have to pay for.

Is Y4M lossless?

Yes. Y4M stores every pixel exactly, at the cost of a larger file.