skills / rik / hdr-footage-guard

HDR footage guard

by Rik

Keep phone footage looking as shot: probe the colour tags, never grade, keep HDR as tagged 10-bit HEVC, check one frame.

@rikv1.0.0CC-BY-4.0 licenceEdit and cutUpdated 2026-11-26

With the vibeedit MCP server added (see https://vibeedit.fun/agent), ask your agent:

Any agentprompt
Install the rik/hdr-footage-guard skill from vibeedit.fun. Show me its SKILL.md first.
Download zip
SKILL.mdRaw file

HDR footage guard

Phone footage often looks right in the camera roll and wrong after an agent has edited it. The usual cause is not a bad grade. It is a plain re-encode, a still grabbed the wrong way, or two segments joined with different colour tags. This skill is the pre-flight and the post-flight for that.

Hard rules

  1. Never change the colour of footage of a person. No grade, LUT, eq (gamma, contrast, brightness, saturation), curves, colour balance, white balance or auto exposure. Not as a default, not to fix a check, not because a critic asks. A check that wants a colour change is wrong: report it and do not grade.
  2. HDR stays HDR. HLG or PQ footage stays 10-bit HEVC with its colour tags. Never squeeze it to 8-bit H.264 with a plain re-encode.
  3. SDR only through the platform's own decoder. If an SDR file or still is needed, convert it only through the system decoder with explicit Rec.709 properties. Never through a plain ffmpeg re-encode or a hand grade.
  4. Designed elements may have their own look. Graphics, b-roll and blurred backdrops can. A dark scrim or grain on a title card is layout, not a grade. The footage of a person never gets one.
  5. Check before you show. Compare one frame of the output with the same frame of the source side by side before the user sees anything.

When to use it

  • Before editing, overlaying, grabbing stills from, exporting or concatenating phone footage.
  • When the user says it looks grey, flat, yellow, darker or "different from the original".
  • When a pipeline step has a colour default (an eq or saturation step, an auto-grade) and you need to know whether it touches footage.

Platform limits

The conversion route in step 4 uses Apple's AVFoundation, so it works on macOS only. On other systems this skill keeps the footage HDR and does not convert. If the user needs an SDR file there, say plainly that this skill does not convert on that system, and let them choose a tool they trust. Do not tone-map with a filter your ffmpeg build does not have. Check with ffmpeg -filters.

Steps

1. Probe every input

ffprobe -v error -select_streams v:0 -show_entries stream=codec_name,profile,pix_fmt,color_space,color_transfer,color_primaries,color_range -of default=noprint_wrappers=1 clip.mov

HLG phone footage reads hevc, Main 10, yuv420p10le, bt2020nc, arib-std-b67, bt2020. A transfer of smpte2084 is PQ. bt709 is SDR. Write the result down (see templates/colour-report.md).

2. Decide: keep HDR or SDR

  • Output can be HDR: keep it HDR. This is the default.
  • Output must be SDR and you are on macOS: step 4.
  • Input is already SDR: nothing to convert. Still no colour filter.

3. Edit without touching colour

Cuts, trims, scales and crops are fine. Find any colour step in your pipeline (eq, lut, curves, colorbalance, saturation, an "auto" setting) and make it a no-op for footage of people. If the pipeline cannot turn it off, stop and tell the user.

Overlaying graphics on HDR footage with a plain ffmpeg re-encode washes the footage out. Composite in a path that understands HDR, or keep graphics as a separate layer and leave the footage file alone.

4. Write HDR output correctly

Keep the encode 10-bit. Some hardware encoders, such as Apple's VideoToolbox encoder, drop the -color_* flags, so write the tags into the bitstream:

-tag:v hvc1 -bsf:v hevc_metadata=colour_primaries=9:transfer_characteristics=18:matrix_coefficients=9

Read the result back with the probe from step 1. The tags must still say BT.2020 and HLG.

For an SDR still or file on macOS, decode through AVFoundation and set primaries, transfer and matrix to Rec.709 explicitly. Two known mistakes: reading the decoder's BT.2020-primaries output as if it were 709, and grading on top of a wrong conversion.

5. Tag every segment before a concat

Segments encoded separately and joined with a stream copy must carry identical colour tags, or the joined file decodes every segment with the first segment's parameters. Put this at the end of each segment's filter chain (a zoom step drops the tags):

setparams=color_primaries=bt2020:color_trc=arib-std-b67:colorspace=bt2020nc:range=tv

Before joining, compare the extradata (the parameter sets) of every segment. If any two differ, do not join.

6. Compare one frame, then show it

Open the source and the output at the same timecode in QuickTime or another HDR-aware player, side by side. Skin tones, shadows and highlights should match. Look at a frame after the first segment boundary too. See references/symptoms-and-causes.md if they do not.

What to tell the user

Say what the inputs were (codec, transfer, primaries), whether the output stayed HDR, whether any colour step was found and switched off, and which frame you compared. If you could not check a frame, say so.

Files

  • references/symptoms-and-causes.md: what a wrong look means and where it usually comes from.
  • templates/colour-report.md: the report to fill in before and after.

Not this skill

  • Creative grading. If the user wants a look, that is their call, on their words, not a default.
  • Tone mapping HDR for platforms on systems without a decoder you can trust.

Examples made with this skill