Tool

Colors or Brightness Changed After Encoding? Diagnose range and matrix Mismatches

Does your encoded video look washed out, or has the contrast gone harsh? Often the video data is fine and what is off is the label (tag) saying ‘this video is limited (16–235)’ or ‘this video is full (0–255)’. Paste the ffprobe output of the source and the result and the tool points out the tag differences, then gives you a command that fixes only the flags and a command that rebuilds from the source. Your input is processed only inside this browser.

Get ffprobe output with ffprobe -hide_banner -i "input.mp4". -show_streams or -print_format json output is read too.

Measured Y

How do I get the ffprobe output?

Open the source and the result with the commands below and paste the whole text that appears. The part in parentheses on the second line, in Stream #0:0 … Video:, such as yuv420p(tv, bt709, progressive), is the color tag. It works with only the result pasted, but if you also have the source, you can compare ‘what changed’.

ffprobe -hide_banner -i "original.mp4"
ffprobe -hide_banner -i "result.mp4"

What the tags tell you, and what they don’t

8-bit video in limited (tv) range uses 16–235 for brightness (Y) and 16–240 for chroma (Cb, Cr), while full (pc) uses all of 0–255. This is covered in the Chapter 1 lesson on how color is represented. A file has a slot that records which of the two it is (video_full_range_flag, and the colr box in the container), and the color_range that ffprobe shows is the value of that slot.

The key question is whether the tag and the actual pixels say the same thing. ffprobe only reads the tag and never opens the pixels, so this tool alone cannot know whether the two disagree. That is why the tool lets you enter the minimum and maximum brightness (YMIN, YMAX) measured on a segment of the result file: if the values stay within 16–235 it judges the data to be limited, and if they span 0–255 it judges it to be full. This criterion is a rule of thumb set by this site.

Narrowing down the cause from the symptom

What you seeCommon causeDirection of the fix
Washed out, black looks grayLimited data read as fullSet the tag to tv (flags only)
Harsh contrast, shadows and highlights crushedFull data read as limitedSet the tag to pc, or convert to limited and re-encode
Same contrast, but hue and saturation are slightly offDifferent matrix (for example BT.601 ↔ BT.709)Correct the tag; if the pixels are wrong, re-encode from the source

The causes in the table above summarize the direction of limited and full interpretation explained in the Chapter 1 lesson. This site has not measured how much each mismatch lowers VMAF or PSNR scores, so no score numbers are given. The VMAF Score Mismatch Diagnoser points out that a range difference can be the reason a score comes out strangely low.

Order of use

  1. Paste the ffprobe output of the source and the result, and pick the symptom you see. The red cells in the table are the tags that disagree.
  2. Use the second line of the ‘Verification commands’ at the bottom to measure YMIN and YMAX on a 30-second segment of the result, and enter the smallest YMIN and the largest YMAX from the output in the fields. A segment that contains both bright and dark scenes works best.
  3. If only the tags are wrong, run ‘Fix the flags only’. It just copies the video and audio data, so it does not take long and the quality does not change.
  4. If the pixel values themselves are wrong, or you cannot tell, use ‘Re-encode from the source’. Choose the CRF and preset for your purpose with the CRF Recommender and the FFmpeg Command Builder.
  5. After fixing, read the tags again with the first line of the verification commands, and compare the same scene side by side with the source in the A/B comparison slider.

Why does this problem happen?

  • Re-encodes that drop the tags: if you do not pass the color tags on purpose, the result may have none. Without tags, players are known to guess from things like the resolution, and when the guess is wrong the colors change.
  • The yuvj name: the j in yuvj420p is an old notation meaning full range. Such video is easily treated as full by its name alone, with no tag, so interpretation can diverge as it passes through other tools.
  • Different handling in players, editors and browsers: some respect the tags, others ignore them and guess. If the same file looks fine in one place and washed out in another, that is a clue that the tags are missing or inconsistent.

Limitations

  • ffprobe shows only tags and does not look at pixels. The actual data range is estimated only from the YMIN and YMAX you measure, and that criterion (limited: YMIN 12 or higher and YMAX 240 or lower; full: YMIN 8 or lower and YMAX 248 or higher) is a rule of thumb set by this site. For dark footage the verdict is withheld. Only 8-bit is handled, so 10-bit values must be converted before you enter them.
  • The matrix cannot be verified from the data. The tool compares assuming the source tag is correct, and when there is no source it assumes the widely known convention of BT.709 for 720p and above and the BT.601 family for anything smaller. There are exceptions (for example PAL vs. NTSC, and broadcast sources).
  • The commands that fix only the flags are for H.264, HEVC and AV1, and this site has not tested them on real files. If the container tag in an MP4 differs from the value inside the video, which one is followed can vary by player, so check again with ffprobe after running them.
  • HDR (PQ, HLG, BT.2020) video is out of scope. If those tags are present, the tool only warns and builds no command; check with the HDR / Dolby Vision Identifier first.
  • We have not measured how a flag mismatch affects VMAF or PSNR, or the quality and time of re-encoding. Keep the source file separately before running any command. The text you enter is not sent to a server.