Y4M File Format (.y4m)
A Y4M file holds YUV4MPEG2 data, raw uncompressed video frames in planar YCbCr with a short plain-text header, the format codec developers feed into encoders like x264, x265 and vpxenc so nothing but the codec under test touches the pixels.
Y4M at a glance#
| Full name | YUV4MPEG2 |
|---|---|
| File extension | .y4m |
| Category | Video Files |
| Developer | mjpegtools project |
| Compression | Uncompressed |
| FileFlip support | FileFlip reads and writes this format |
What a .y4m file can hold#
These are the things a Y4M file either supports or does not, and they are what decides whether a conversion keeps everything or quietly drops something.
| Lossless compression | Yes |
|---|---|
| Video | Yes |
Strengths and limitations of Y4M#
What Y4M does well
- Every pixel is exactly what the source produced, with no compression artefacts to separate an encoder's output from its input
- The stream and per-frame headers are plain ASCII text, so a shell script can inspect or generate them without a parsing library
- Almost every codec reference encoder and test harness accepts Y4M directly, which is why it stayed the standard interchange format for encoder benchmarking
Where Y4M falls short
- File size is enormous: a minute of 1080p video runs into gigabytes, since there is no compression at all
- It carries no audio track whatsoever, only video
- Frame headers vary in position rather than sitting at fixed offsets, so a Y4M file cannot be seeked into the way a compressed format with an index can
Use Y4M when testing or comparing video encoders, where the point is to remove every other codec from the pipeline so the one under test is the only variable.
Convert Y4M to a compressed format like MP4 for anything other than encoder testing, since the raw size makes it impractical to store or share.
How to open a .y4m file#
A .y4m file opens in the programs below, grouped by the platform you are on. If you would rather not install anything, FileFlip converts Y4M into a format your machine already opens, and it does it in the browser tab rather than on a server.
| Platform | Programs that open it |
|---|---|
| Windows | ffplay, mpv |
| macOS | ffplay, mpv |
| Linux | ffplay, mpv, VLC |
| Web | FileFlip |
Y4M questions people ask#
Why is a Y4M file so much bigger than the video it represents?
A Y4M file stores every pixel of every frame with no compression at all, unlike MP4 or MKV, which is exactly the point: encoder developers use it as clean, unaltered input so nothing but the codec being tested affects the result. A minute of 1080p footage can run to several gigabytes.
What is Y4M used for?
Y4M is the standard input format for testing and benchmarking video encoders such as x264, x265 and libvpx, because raw, uncompressed frames guarantee the encoder is working from an unaltered source rather than one already degraded by another codec.
Does a Y4M file have sound?
No, Y4M carries video only. It was designed purely as a way to pipe raw frames between video tools, with no provision for an audio track at all.
Converting Y4M files#
Convert Y4M to another format
Convert another format to Y4M
Every conversion runs inside your browser. The file is read from your disk, the work happens on your own machine, and nothing is uploaded. How FileFlip works names the engine behind each family and how to verify that for yourself.