AI Video Editing Flows

Colour and sound checks before you ship: tone mapping, a grade checklist, drift and pop-ups

Five checks we run before a video ships: tone-map HDR phone footage, check the grade on the final file, plan screen tutorials around the voice, stop audio drifting when clips are joined, and catch pop-ups in screen recordings. The FFmpeg commands were run on test clips.

The checks

  • HDR phone footage (HLG) is tone-mapped to Rec.709 first, and every grade comes after.
  • A grade is checked on the final file, next to work we already approved.
  • A narrated screen tutorial starts from the voice, and the clicks are timed to the words.
  • When clips are joined, each clip's audio is fitted to its picture first.
  • Screen takes are scanned for pop-ups before anyone edits them.

Tone-map HLG phone footage

Recent phones record HDR in HLG. Shown as it is on a standard screen the picture looks flat and grey, so the first step is a tone-map to Rec.709 with the hable curve and a small lift, scaled to 1080p. Check what you have first.

Is it HLG? (arib-std-b67 means yes; smpte2084 means PQ)
ffprobe -v error -select_streams v:0 -show_entries stream=color_transfer -of default=nw=1 hlg.mp4
HLG to a Rec.709 master
ffmpeg -y -i hlg.mp4 -vf "zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=hable:desat=0,zscale=t=bt709:m=bt709:r=tv,format=yuv420p,eq=contrast=1.06:saturation=1.08:brightness=0.01,scale=1920:1080:flags=lanczos" -c:v libx264 -crf 15 -pix_fmt yuv420p -color_primaries bt709 -color_trc bt709 -colorspace bt709 -r 30 master709.mp4

We ran both on a generated 4K test clip tagged HLG. The probe reported arib-std-b67; the master came out as width 1920, height 1080, pix_fmt yuv420p, color_space bt709, color_transfer bt709, color_primaries bt709, r_frame_rate 30/1. The filter string ran without error.

Limit: the test clip is a generated pattern, not phone footage. We confirmed that the command runs and tags the file correctly. We did not judge the look of the grade on real HLG footage here, and an SDR source skips the tone-map and only needs the eq step.

Check the grade on the final file

A grade can look right in the editor and wrong after export. Run this list on the file you will upload, not on the master.

  1. Look at faces first. Skin should sit in the same range as your approved work.
  2. Compare numbers, not memory. Sample frames from wide shots and close shots and compare the average brightness with three or four finished videos you already approved.
  3. Put a new frame next to an approved one at full size and at phone size.
  4. Clear the render and thumbnail caches when the master changes, then check the thumbnails and reel covers separately, because they have their own cache.
  5. Leave screen recordings ungraded.
  6. Ask someone who did not grade it to compare grade, contrast, captions and sound with the approved videos.
Average brightness (YAVG) of a frame every two seconds
ffmpeg -i clip.mp4 -vf "select='not(mod(n,48))',signalstats,metadata=print:key=lavfi.signalstats.YAVG:file=stats.txt" -f null -
A side-by-side board of two videos at phone height
ffmpeg -y -i clip.mp4 -i microzoom.mp4 -filter_complex "[0:v]select=eq(n\\,60),scale=-2:640[a];[1:v]select=eq(n\\,60),scale=-2:640[b];[a][b]hstack" -frames:v 1 board.png

On our test clip the first command printed 115.739, 116.005, 116.943, 116.966 for four frames two seconds apart, and the board command wrote a 2.2 MB image. Both ran without error.

Plan a screen tutorial around the voice

Write and record the voice before you record the screen. Get word times from the final voice track (our We tested faster-whisper captions on three dialogue clips shows how, with a measured error rate). Then either script the screen take so each click lands on its word, or cut and speed-fit each part of the take to the words. For an automated take, the wait before each action is the word's start time minus the time of the previous action. Finish with a speech-to-text pass on the final mix and a frame-by-frame scrub.

This is a method, not a command, so there is nothing to run here. We list it because the order matters: a tutorial recorded first and narrated after will always drift from its words.

Audio drifts across joined clips

When clips are joined, the sound can fall out of step with the picture. A clip whose audio is a few milliseconds longer than its picture is enough: the error adds up at every join. Fit each clip's audio to the exact length of its picture, then join.

Pad or trim the audio to 5.0 s, the picture length, then join
ffmpeg -y -i raw0.mov -af "apad,atrim=end=5.0,asetpts=PTS-STARTPTS" -c:v copy -c:a pcm_s16le fixed0.mov
Ten clips, picture 5.0 s each, audio 5.043 sPicture (s)Audio played (s)
Joined as they came5050.43
Audio fitted first (uncompressed audio per clip)5050
Audio fitted first, but encoded as AAC per clip5050.35

Replace 5.0 with the picture length of each clip, which ffprobe gives you. Keep the audio uncompressed while you join and encode once at the end.

Pop-ups in a screen take

A toast, an update prompt or a licence nag landing in a take wastes the take. Prevention is plain: record under a separate user with notifications off. We have not tested that part. Detection we can test: compare every frame with one clean frame of the same screen and flag the frames that differ.

Flag frames that differ from a clean reference frame
ffmpeg -i take.mp4 -loop 1 -framerate 24 -i clean.png -filter_complex "[0:v][1:v]blend=all_mode=difference:shortest=1,signalstats,metadata=print:key=lavfi.signalstats.YAVG:file=diff.txt" -f null -

We made a six-second still screen with a white box that appears from 3.0 to 4.5 seconds. The command flagged 37 of 144 frames, from 3 to 4.5 seconds, which is exactly the pop-up. The frames without it scored 1 and the frames with it above 8 on the brightness scale, so a threshold of 2 separates them here. A real screen with a moving cursor or a clock needs a mask over those areas first.

What failed or surprised us

  • Fitting each clip's audio was not enough on its own. Our first fix encoded every clip's audio as AAC and joined with a stream copy; the audio still ran 0.347 s long over ten clips, because every AAC clip carries its own padding. Uncompressed audio per clip, one encode at the end, brought it to 0 s.
  • The tone-map test clip is generated, so it proves the command and the tags, not the look.
  • The pop-up test used a screen with nothing moving. Real screens need masks.

Method and limits

Every command on this page was run with FFmpeg 8.1.2-full_build-www.gyan.dev on a Windows laptop, from one folder, with the file names shown. The clip is eight seconds of Tears of Steel, (CC) Blender Foundation, mango.blender.org, CC-BY 3.0; other inputs were generated by FFmpeg or by a short script. The measurements are on our test clips, not a survey of footage. Where a rule is our habit and not something we measured, the page says so. Our method is on {link:VID-trust-method}.

  • The audio test uses generated sine tones and test patterns, so it measures drift and not sound quality.
  • The grade checklist is our process. We do not claim it catches every grade fault.

Page checked on Nov 4, 2026.