Reference · Legacy archive
YUVTools and raw YUV video, explained
What raw YUV files are, why they need special handling, and the kinds of tasks YUVTools was historically associated with.
This page is informational only. Sunray Image does not offer YUVTools or any other software, downloads, licences or technical support, and is not affiliated with the original developer.
§ 01
What is raw YUV?
YUV describes colour as one brightness signal and two colour-difference signals. Y (luma) carries the black-and-white detail; U (Cb) and V (Cr) record how far each pixel leans toward blue or red. Because the eye is far more sensitive to brightness than to colour, the chroma planes can be stored at reduced resolution with little visible loss.
A raw YUV file is simply those samples written one after another, frame after frame, with no header. Nothing inside the file states its width, height, frame rate or pixel format. Open it with the wrong settings and the picture turns into diagonal stripes or green-and-pink noise.
§ 02
Common raw formats
Formats differ in how much chroma they keep (sampling) and how the samples are arranged in memory (layout). Planar formats store each component in its own block; packed formats interleave them pixel by pixel. See our guide to planar vs. packed layouts.
| Format | Sampling | Layout | Byte order | Bits / pixel |
|---|---|---|---|---|
| I420 / IYUV | 4:2:0 | Planar | Y, then U, then V | 12 |
| YV12 | 4:2:0 | Planar | Y, then V, then U | 12 |
| NV12 | 4:2:0 | Semi-planar | Y, then interleaved UV | 12 |
| NV21 | 4:2:0 | Semi-planar | Y, then interleaved VU | 12 |
| YUY2 / YUYV | 4:2:2 | Packed | Y0 U Y1 V | 16 |
| UYVY | 4:2:2 | Packed | U Y0 V Y1 | 16 |
| I422 | 4:2:2 | Planar | Y, then U, then V | 16 |
| I444 | 4:4:4 | Planar | Y, then U, then V | 24 |
Frame size (8-bit 4:2:0) = width × height × 1.5 bytes
1920 × 1080 × 1.5 = 3,110,400 bytes per frame
§ 03
Functions associated with YUVTools
YUVTools was known as a set of utilities for engineers and researchers working with uncompressed video — people testing codecs, capture devices and image-processing algorithms. Its functions fell into four broad groups.
01 · VIEW
Viewing
Displaying headerless YUV files frame by frame. Because raw files carry no metadata, the user supplied the width, height and pixel format so the viewer could interpret the bytes, then stepped or played through frames and inspected individual Y, U and V planes.
02 · CONVERT
Conversion
Translating between layouts and sampling schemes — for example planar I420 to packed YUY2, 4:2:2 to 4:2:0, or YUV to RGB bitmaps and back — so that sequences could move between encoders, capture hardware and test tools.
03 · EDIT
Editing
Basic sequence surgery on raw material: extracting a frame range, cropping or resizing, joining clips, and rearranging frames, all without introducing compression into test footage.
04 · ANALYZE
Analysis
Comparing a processed sequence against its reference. Typical measurements included per-frame PSNR and pixel-difference views that highlight where an encoder or filter changed the image.
§ 04
Working with raw YUV today
The underlying tasks have not gone away. Whatever tool you use, the essentials are the same:
- Record the resolution, pixel format and frame rate alongside every raw file, ideally in the file name (for example
clip_1920x1080_i420_25fps.yuv). - Check the file size: it should be an exact multiple of the frame size. If it isn't, one of your assumptions is wrong.
- Confirm whether the data is limited range (16–235) or full range (0–255) and which matrix (BT.601 or BT.709) it uses before converting to RGB.
- When comparing sequences, align frames first. A one-frame offset makes every metric meaningless.
For worked numbers and byte-offset walkthroughs, see our Examples page.
Related reading: What a raw video viewer actually does, Chroma subsampling explained and PSNR, SSIM and your eyes.