Video Quality Compare
Operator: Abdulla Al Fahad. How tools are built and checked
An average quality number hides the moment that matters. A CRF 28 encode can score well over a whole film and still fall apart in one dark, grainy scene, and that scene is the one viewers notice. This page measures an encode against its source at many moments and draws the scores over time, so a dip has a time stamp you can open.
Both videos are read at the same moments, drawn to the same size, and scored on brightness with PSNR and SSIM. The worst moments are listed, and any moment can be shown side by side, as a wipe between the two, or as an amplified difference.
Key features
- PSNR in decibels and SSIM on the luma of each sampled frame pair, with the mean, the lowest value and the mean of the worst 5% of PSNR
- A time offset of plus or minus 5 seconds, so an encode that starts late or early is compared against the right frames
- Two charts over time that keep the lowest value of every group of samples, so a short dip does not vanish when the chart is squeezed
- A list of the ten worst moments, no two within a second of each other, ranked by PSNR or SSIM
- A viewer with three modes, and a CSV of every sample with both time stamps
How the two videos are aligned and scored
Both files must be ones the browser can play. Up to 20 minutes can be compared, at most 3,000 sampled moments, and no step shorter than 0.04 seconds, which is one frame of a 25 fps video. You can set the compared range and the step; the number of samples that produces is shown before you start. The range always stops 0.04 seconds before the end of the shorter video, because a video cannot be read at its last instant and the two files would otherwise be compared at different frames.
Frames are drawn at an analysis width of 320, 480, 640 or 960 pixels, never wider than the reference. The encode is scaled to the reference's size before it is measured, so an encode at a different resolution is compared as if it were shown at the source's size, and a note appears when the sizes differ.
The encoded video is read at the reference time plus the offset. A positive offset means the encode runs later than the source.
Frame reading happens in the page, by seeking a hidden video to each moment. The PSNR and SSIM arithmetic runs in a worker, and up to six frame pairs wait there while the next ones are being read.
How it works
The browser decodes each frame to RGB. The page takes the luma of that picture with the BT.709 weights (0.2126 red, 0.7152 green, 0.0722 blue), rounded to 8 bits. This is the brightness of the picture as shown, not the codec's own Y plane, so values can differ slightly from a tool that reads the raw Y.
PSNR is 10 times the base-10 logarithm of 255 squared over the mean squared difference. Identical frames would be infinite, so they are scored 100 dB and counted as identical.
SSIM uses windows of 8 by 8 pixels moved 4 pixels at a time. Inside a window every pixel has the same weight, K1 is 0.01, K2 is 0.03 and variances are taken over the window's 64 pixels. The score of a frame is the mean over its windows. Other tools use Gaussian windows or a different stride, so the same pair can score a little differently elsewhere.
The worst-moments list takes the lowest score first, then skips any sample within a second of one already listed, so ten entries describe ten different scenes and not ten neighbouring frames of one.
The wipe puts the reference on the left of the line and the encode on the right. The difference view shows the absolute difference of each colour channel multiplied by 1 to 16, so a difference of 3 levels, invisible by eye, can be made as bright as 48.
Common use cases
- Choosing between CRF 24 and CRF 28 for a two-hour film: sample every 5 seconds over the first 20 minutes, 240 samples each, and compare the worst 5% PSNR of the two encodes, since the mean differs little.
- An encode that looks soft in one scene: sample every 0.1 seconds over that minute, open the lowest SSIM moment as a difference and see whether the error sits on the grain or on the edges.
How to use this tool
- Drop the original as the reference and the encode as the encoded video, and wait for both previews to load.
- Set the offset if the encode starts late, then pick a step; every 0.5 seconds is a sensible start for a long clip.
- Press Compare. The page reads frame pairs and shows how long it expects to take.
- Click a dip in a chart or a line in the worst-moments list, switch the viewer to Difference, and download the CSV if you want the numbers.
Example
A 60-second source and a 60.12-second encode that starts 0.12 s late
Offset 0.12 s, sample every 0.5 s, analysis width 480 pxWhat the page plans and how to read the score
120 samples, from 0 s to 59.5 s; the range ends at 59.96 s, and at 0.04 s it would hold 1,500 samples.
At reference time 10.0 s the encode is read at 10.12 s.
For scale: a brightness error of exactly 4 levels on every pixel is 10 x log10(255 squared / 16) = 36.09 dB, and an identical pair is reported as 100 dB.Common pitfalls
A wrong offset lowers every score and gives a sawtooth chart that follows camera motion. If both charts look jittery, try offsets of plus and minus a frame or two before judging the encode.
Frame-accurate seeking depends on the browser. Seeking to a time lands on a displayed frame near it, which may be a neighbour of the one you meant in variable-frame-rate files; a one-frame mismatch lowers the score in motion-heavy scenes.
PSNR and SSIM on luma ignore colour. An encode with shifted or washed-out colour can score well here, so open the side-by-side view before concluding that it matches.
Scores come from frames scaled to at most 960 pixels wide. Fine noise and ringing that exist only at full resolution are averaged out; this suits finding bad scenes, not certifying a delivery.
- When the lowest points of PSNR and SSIM are at different moments, open both: PSNR follows the size of the error, SSIM follows whether structure such as edges and texture survived.
- A chart that follows the source's scene changes is normal, since busy scenes score lower at the same bit rate. The signal to look for is a dip deeper than its neighbours of similar content.
Common errors and how to fix them
- That is 6,000 samples; the page takes at most 3,000
- Use a longer step or compare a shorter range. A 20-minute range at 1 second is 1,200 samples.
- The compared range is empty. Check the start, end and offset
- The end must come after the start once the offset is applied. An offset of 8 seconds on a 6-second encode leaves nothing to compare; set the offset back inside the encode's length.
- "encode.mp4" is empty (0 bytes), so there is nothing to open
- The file did not finish copying or exporting. Export or fetch it again before comparing.
Best practices
- Compare against the original master or the highest-quality copy you have; scoring an encode against another encode measures only how far apart the two are.
- Keep the analysis width the same when you compare two encodes against each other, since width changes the score.
- Quote the settings with the numbers: the step, the analysis width and whether the offset was zero.
Frequently asked questions
Why can't it score every frame?
Each sample needs a seek in two videos, and seeking is slow compared with decoding in order. The step is yours to set down to 0.04 seconds, and the cap of 3,000 samples keeps a run to minutes, not hours.
Is a PSNR of 40 dB good?
For 8-bit video, encodes of ordinary footage usually land between about 30 and 50 dB. Above roughly 40 dB the difference from the source is generally hard to see at normal viewing size. Between 30 and 35 dB, softening and blocking become visible in detailed or grainy scenes, and below 30 dB the damage is usually obvious. These are rules of thumb: PSNR counts pixel error, not what the eye notices, so grain and fine texture score lower than flat areas at the same visual quality. This page also measures luma only, so other tools may print a slightly different figure for the same pair. Use the number to compare encodes of one source, treat a gap of a fraction of a decibel as noise, and judge by the worst moments.