If a score looks strangely low, the measurement setup is more likely wrong than the codec. Check the three classic pitfalls.
VMAF and PSNR compare pixels on the assumption that the two videos are the same frame at the same position. If that assumption breaks, the score comes out low no matter how well the encoder did its job. When a score doesn't make sense, check the measurement setup before you suspect the codec.
To compare a video whose resolution was lowered during encoding (for example, the 720p rung of a ladder) against the original (1080p), you have to make the two the same size. The usual approach is to scale the result up to the original resolution before comparing. If you feed in mismatched sizes as they are, you get an error, or unintended processing can sneak in. How you scaled up (bicubic, for example) also affects the score, so write it down.
As you learned in Chapter 1, YUV comes in limited range (16 to 235 at 8-bit) and full range (0 to 255). If one side is interpreted as limited and the other as full, the brightness shifts across the board and the score drops. Make the pixel formats (yuv420p versus 10-bit, and so on) match between the two inputs as well. Check color_range and pix_fmt on both sides with ffprobe.
ffprobe -v error -select_streams v:0 -count_frames \
-show_entries stream=width,height,pix_fmt,color_range,r_frame_rate,nb_read_frames \
-of default=noprint_wrappers=1 reference.y4m
ffprobe -v error -select_streams v:0 -count_frames \
-show_entries stream=width,height,pix_fmt,color_range,r_frame_rate,nb_read_frames \
-of default=noprint_wrappers=1 encoded.mkv
# Check that width/height, pix_fmt, color_range, and the frame count match in both outputsThe average VMAF measurement on this site fixed the input to the first 250 frames of a yuv420p 8-bit, 1920x1080, 25 fps source, and compared each encoded result frame by frame against the same source. With no resolution conversion or frame-rate conversion, the design leaves little room for the three pitfalls above to creep in from the start.
① Scores are evenly low on every frame → frame misalignment or a color range mismatch. ② Only the first few frames are low → a start-time difference or something special about the first frame. ③ Scores are abnormally high or stuck at 100 → check that you didn't feed in the same file twice. If you can't find the cause, pull one frame as a PNG from each side with ffmpeg and compare them by eye.
Making sure frames from the same moment in the two videos being compared are paired up.
The time at which a frame is shown. If the two videos start at different times, the pairing goes out of step.
Whether brightness uses 16 to 235 or 0 to 255 at 8-bit.
Video whose frame spacing is not constant. A common cause of mismatched frame counts.
Video whose frames always sit at the same interval. At 30 fps that is about 33.3 ms per frame. Check for VFR with the tool 'Variable Frame Rate (VFR) Detector'; converting VFR to CFR duplicates or drops frames, so it requires re-encoding.
The VMAF of an encoded result came out strangely low, evenly across every frame. What should you check first?