Skip to content

Instantly share code, notes, and snippets.

@rodrigopolo
Last active December 26, 2025 03:40
Show Gist options
  • Select an option

  • Save rodrigopolo/72fa4e112282f6200798897c55b79d9c to your computer and use it in GitHub Desktop.

Select an option

Save rodrigopolo/72fa4e112282f6200798897c55b79d9c to your computer and use it in GitHub Desktop.

Internal vs External Recordings and Levels

NLE timelines work in legal/video levels internally

Data Tag Result NLE Action (Timeline/Viewer)
Legal None [Good] Works (assumes legal) No conversion. Legal data displayed as legal levels in timeline. Correct.
Legal Legal [Good] Perfect No conversion. Legal data displayed as legal levels in timeline. Correct.
Full Full [Good] Perfect Compresses full (0-255) to legal (16-235) for timeline.
Full None [Bad] Crushed/clipped (assumes legal) No conversion applied. Full range data treated as legal in timeline. Values 0-15 are below legal black, 236-255 above legal white. Causes clipping/super-blacks.
Full Legal [Bad] Severe clipping No conversion applied. Full range data treated as legal in timeline. Values 0-15 are below legal black, 236-255 above legal white. Causes clipping/super-blacks.
Legal Full [Bad] Washed out Compresses legal (16-235) to "legal" (16-235 → ~38-217 in legal space). Reduces contrast, washed out look.

Check the range of the input files

mediainfo IMG_5889-Rec.2020-Clog3-internal.MP4 | grep -i range
mediainfo NINJAV_S001_S001_T006-Rec.2020-Clog3-external.MOV | grep -i range

exiftool -s -G IMG_5889-Rec.2020-Clog3-internal.MP4 | grep -i canon
exiftool -s -G NINJAV_S001_S001_T006-Rec.2020-Clog3-external.MOV | grep -i canon

External recording in full range, without tags

ffmpeg \
  -i NINJAV_S001_S001_T006-Rec.2020-Clog3-external.MOV \
  -c copy \
  -map_metadata -1 \
  -map_metadata:s:v 0:s:v \
  -map_metadata:s:a 0:s:a \
  01-external_notags.MOV

mediainfo 01-external_notags.MOV | grep -i range

External recording in full range, tagged as full range

ffmpeg \
  -i 01-external_notags.MOV \
  -c copy \
  -color_range pc \
  -colorspace bt709 \
  -color_primaries bt709 \
  -color_trc bt709 \
  -movflags use_metadata_tags \
  02-external_tagged_as_full.MKV

mediainfo 02-external_tagged_as_full.MKV | grep -i range

Internal recording in full range to legal range

ffmpeg -i IMG_5889-Rec.2020-Clog3-internal.MP4 \
  -c copy \
  -color_range tv \
  -colorspace bt2020nc \
  -color_primaries bt2020 \
  -color_trc smpte2084 \
  -movflags use_metadata_tags \
  03-Internal_Tagged_As_Legal.MP4

mediainfo 03-Internal_Tagged_As_Legal.MP4 | grep -i range
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment