/hildegard:hildegard-video-editfrom hildegard
Edits video with FFmpeg: trimming, cutting clips into reels, short films from long recordings, titles, grading, captions, vertical crops, music, and loudness normalization.
Ships in hildegard. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Cut footage into a finished piece with tested scripts and plain FFmpeg, then check it. Make it shorter, clearer and
cleaner: editing is where slop (transitions, filler, loud music) is made or removed. The user's request wins over every
default here. Work on copies and never overwrite the user's originals; write to a new folder such as edit/.
HG in a command is the folder that holds the Hildegard skills (this skill's folder sits in it).
If you read nothing else, do these steps.
ffprobe -v error -show_entries stream=codec_type,width,height,r_frame_rate,duration -of compact input.mp4) and
make a contact sheet: python3 scripts/contact_sheet.py input-sheet.png --video input.mp4 --every 2. Everything you
join must match one size and frame rate. Note anything shot in HDR (section 2).references/long-recordings.md. Clips into a reel with titles and music: scripts/cut_reel.py (below), or Recipe D in references/recipes.md
when you can deliver only one bash script.python3 scripts/check_video.py and the brief's numbers until every line says OK, then look at the
sheet and read every title and caption on it.A plan for the user's own machine must stand alone: plain FFmpeg and each program pasted whole, since they don't have this skill's scripts.
python3 scripts/clean_voice.py in.wav out.wav --lufs -16 (the same script as in the
hildegard-sound skill).python3 scripts/duck_mix.py voice.wav music.wav out.wav. With --total shorter than the
voice it stops and says how many seconds over; it never cuts the voice. Raise --total, or add --allow-overrun.python3 scripts/spot.py out.wav --music music.wav --sting sting.wav --lines a.wav b.wav c.wav --total 15.
If the lines can't fit --total it stops and says how many seconds over; it never cuts a line.python3 scripts/cut_reel.py out.mp4 --size 1280x720 --fps 30 --fade 0.4 --total 25 \
--clip [email protected] --clip [email protected] --clip [email protected] --clip [email protected] \
--clip [email protected] --clip [email protected] --clip [email protected] --clip [email protected] \
--music music.wav --lufs -16 --title "Hollis Creek Canoe Rental" --card "Open May to October - Rt 122, Hollis NH"
--clip FILE@IN-OUT in seconds, in the order of the cut. Use every clip, and cut each one into two or more shots when
the brief wants many cuts: a cut is a change of shot, so four clips used once make three. --fade 0 gives hard
cuts. A vertical clip sits whole over a blurred copy of itself, never stretched. --total trims the shots equally
to an exact length. The title is a lower third near the start; the card is dark blue, never black.
python3 scripts/check_video.py out.mp4 --min 22 --max 28 --size 1280x720 --fps 30 --lufs -16 --cuts 5
Use the numbers from the brief. Every line must say OK: length in range, size and frame rate, H.264 and AAC, loudness within 1 LU of the target, true peak under -1 dBTP (--peak changes it), no black stretch over half a second, enough cuts (counted from the picture: crossfades count, motion inside one shot does not). Any FIX line says what to change; change it and run again. Then look at the picture: python3 scripts/contact_sheet.py sheet.png --video out.mp4 --every 2, and read the titles on the sheet. With no Python, Recipe D (references/recipes.md) prints the same checks at its end.
Every command below is plain FFmpeg (any build from 5.0 up). Check each output and look at the sheet before moving on:
python3 scripts/contact_sheet.py sheet.png --video <file> --every 2 for the sheet, and for the technical checks
(exposure, frozen frames, flicker, color, black frames, sound clipping; install the packages once with
python3 -m pip install pillow numpy av; check_video.py and the sound scripts need none)
echo '{"path": "<file>", "sheet": "sheet.jpg", "final": false, "film": true, "audio": true}' > spec.json then
python3 scripts/review_media.py spec.json. Slop to cut is listed in references/slop.md.
Cut on action (a hand moves, a head turns) or on a look; never in the middle of a word. Find times from the contact sheet and by checking frames:
ffmpeg -ss 00:00:03.20 -i input.mp4 -frames:v 1 -q:v 2 check.jpg # the frame at 3.2 s
Frame-accurate trim (re-encodes; -ss after -i for accuracy):
ffmpeg -i input.mp4 -ss 3.20 -to 7.85 -c:v libx264 -crf 17 -preset slow -c:a aac -b:a 192k cut.mp4
Same size, frame rate and audio on every clip first. Keep the sound PCM until the last step: AAC parts leave a gap at every join.
ffmpeg -i clip.mp4 -vf "scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,fps=24,setsar=1" \
-c:v libx264 -crf 14 -preset slow -c:a pcm_s16le -ar 48000 -ac 2 norm-1.mkv
In a shell loop that reads a list, every ffmpeg needs -nostdin, or it eats the rest of the list. Phone footage is often HDR
(ffprobe -select_streams v -show_entries stream=color_transfer says arib-std-b67 or smpte2084); joined as it is, it looks gray. Convert it
first, before any scale or grade:
HDR="zscale=t=linear:npl=203,format=gbrpf32le,zscale=p=bt709,tonemap=mobius:param=0.6:peak=4.9:desat=0,zscale=t=bt709:m=bt709:r=tv,format=yuv420p"
On test bars mobius put mid gray back where it started; hable, the usual copy, left it a third too dark.
(A clip without sound: add -f lavfi -i anullsrc=r=48000:cl=stereo -shortest as a second input.)
Join with straight cuts (the default; use it):
printf "file '%s'\n" norm-1.mkv norm-2.mkv norm-3.mkv > list.txt
ffmpeg -f concat -safe 0 -i list.txt -c copy assembly.mkv
A dissolve only where time passes; half a second is plenty:
ffmpeg -i a.mp4 -i b.mp4 -filter_complex \
"[0:v][1:v]xfade=transition=fade:duration=0.5:offset=<A_LENGTH_MINUS_0.5>[v];[0:a][1:a]acrossfade=d=0.5[a]" \
-map "[v]" -map "[a]" -c:v libx264 -crf 17 -c:a pcm_s16le dissolve.mkv
No spins, glitches, flashes, zooms or wipes between shots. They are filler.
Steps 3 to 6 write .mkv: it holds the PCM sound, and MP4 does not in every build. Section 7 makes the MP4 with AAC, once.
Grade toward what the brief asks, and usually down: generated footage is often oversaturated.
# Calm saturation, a touch more contrast, slightly warmer:
ffmpeg -i in.mp4 -vf "eq=saturation=0.85:contrast=1.05,colortemperature=temperature=6000" -c:a copy -crf 17 graded.mkv
# Lift the blacks for a softer, filmic print:
ffmpeg -i in.mp4 -vf "curves=all='0/0.04 0.5/0.5 1/0.97'" -c:a copy -crf 17 lifted.mkv
# A LUT, if your user has one:
ffmpeg -i in.mp4 -vf "lut3d=look.cube" -c:a copy -crf 17 lut.mkv
Match shots to each other: grade the most important shot first, then bring the others to it. Look at the contact
sheets side by side. The review's colour check failing means you pushed too far.
# Stabilise handheld footage (two passes):
ffmpeg -i in.mp4 -vf vidstabdetect=shakiness=5:result=transforms.trf -f null -
ffmpeg -i in.mp4 -vf "vidstabtransform=input=transforms.trf:smoothing=20,unsharp=5:5:0.4" -c:a copy -crf 17 steady.mkv
# Flicker in generated footage (mild):
ffmpeg -i in.mp4 -vf deflicker=size=5 -c:a copy -crf 17 deflickered.mkv
# Noise, gently:
ffmpeg -i in.mp4 -vf hqdn3d=2:1:3:3 -c:a copy -crf 17 clean.mkv
Sharpen only a little (cas=0.3 or unsharp=5:5:0.4). Halos are slop.
Don't squash; crop around the subject. Find where the subject is on the contact sheet (as a fraction of the width, 0 = left), then:
# Subject at about 40% across a 1920x1080 frame:
ffmpeg -i in.mp4 -vf "crop=ih*9/16:ih:(iw*0.40)-(ih*9/16)/2:0,scale=1080:1920" -c:a copy -crf 17 vertical.mkv
Clamp the x offset to between 0 and iw-ih*9/16. If the subject moves across the frame, cut it into parts with
different offsets rather than letting the subject leave the frame.
Write captions as SRT: at most two lines, about 42 characters a line (about 28 on a vertical video, or each line wraps into two), on screen at least 1 second, broken at natural pauses. Then burn them in with a plain, readable style:
# Any 16:9 video. Keep the numbers as written: libass scales from PlayRes to the frame. Without PlayRes it uses a 288-line canvas.
ffmpeg -i in.mp4 -vf "subtitles=captions.srt:force_style='PlayResX=1920,PlayResY=1080,FontName=Source Sans 3,FontSize=56,PrimaryColour=&H00FFFFFF,OutlineColour=&H80000000,BorderStyle=1,Outline=4,Shadow=0,MarginV=90,MarginL=100,MarginR=100'" \
-c:a copy -crf 17 captioned.mkv
# Any 9:16 video: higher, and off the right edge, so the app's own buttons and caption don't cover it
ffmpeg -i in.mp4 -vf "subtitles=captions.srt:force_style='PlayResX=1080,PlayResY=1920,FontName=Source Sans 3,FontSize=64,PrimaryColour=&H00FFFFFF,OutlineColour=&H80000000,BorderStyle=1,Outline=4,Shadow=0,MarginV=420,MarginL=80,MarginR=140'" \
-c:a copy -crf 17 captioned-vertical.mkv
For another shape, set PlayRes to the video's size and scale the font size, outline and margins to match. Look at one
captioned frame at phone size before you call it done:
ffmpeg -ss <time> -i captioned-vertical.mkv -frames:v 1 -vf scale=420:-1 caption-check.png. Check the words against the audio; a wrong caption is worse than none. Get the words with times from a local Whisper
(faster-whisper with word_timestamps=True, or whisper.cpp with -osrt); if you can't transcribe, ask your user for
the script.
Fades at every audio cut (5 to 20 ms) so nothing clicks: afade=t=in:d=0.01,afade=t=out:st=<END-0.01>:d=0.01.
Narration and effects, free: node "$HG/hildegard-sound/scripts/voice.mjs" --file vo.txt --out vo.wav (Kokoro,
Apache-2.0) and node "$HG/hildegard-sound/scripts/sfx.mjs" --engine freesound --prompt "door creaks" --seconds 3 --out fx.wav
(CC0, free key); engines and licenses in HG/hildegard-sound/references/free-voice-and-sfx.md.
Music under speech: don't hand-write a sidechain graph. Use scripts/duck_mix.py (or Recipe B of the hildegard-sound skill). It
drops the music 16 dB while the voice speaks and brings it back in pauses. (If you do write sidechaincompress yourself, split the
voice with asplit first: a label can feed only one filter.)
Master the loudness last, two passes, to about -14 LUFS with peaks under -1 dB:
ffmpeg -i mixed.mp4 -af loudnorm=I=-14:TP=-1.5:LRA=11:print_format=json -f null - 2> loud.txt
# The JSON at the end of loud.txt has input_i, input_tp, input_lra, input_thresh and target_offset. Put them in:
ffmpeg -i mixed.mp4 -af "loudnorm=I=-14:TP=-1.5:LRA=11:measured_I=<input_i>:measured_TP=<input_tp>:measured_LRA=<input_lra>:measured_thresh=<input_thresh>:offset=<target_offset>:linear=true" \
-c:v copy -c:a aac -b:a 192k -ar 48000 master.mp4
Use -16 LUFS for speech-only pieces and podcasts. Print the second pass's JSON too: "normalization_type": "dynamic" means it could not reach
the target without pumping (a quiet mic with loud peaks). Then put acompressor=threshold=-24dB:ratio=3:attack=5:release=120,alimiter=limit=0.8 first, and measure again.
check_video.py lines as printed; never claim a check you did not run.Slot-based assembly invariants (non-negotiable production correctness):
-c copy concat (avoid double-encoding); pad every cut edge 30-200 ms snapped to word boundaries and apply 30 ms audio fades (afade) at segment boundaries.setpts=PTS-STARTPTS+<offset_s>/TB (for example setpts=PTS-STARTPTS+4.5/TB; never literal T, which is FFmpeg's frame-time variable), compute master SRT timestamps on the output timeline (word.start - segment_start + segment_offset), and burn subtitles LAST after every overlay.-14 LUFS and <= -2.0 dBTP after AAC encoding (AAC raises inter-sample peaks) and run --max-freeze 0.5 on continuous animations.ffmpeg -i master.mp4 -c:v libx264 -crf 18 -preset slow -pix_fmt yuv420p -movflags +faststart -c:a copy final.mp4 # the sound is section 7's AAC, untouched
python3 scripts/check_video.py final.mp4 --lufs -14 --size 1920x1080 # then the sheet and the spec.json checks above, with "final": true
python3 scripts/check_sync.py --video final.mp4 --min-liveness 0.55 --max-freeze 0.5 --post-aac-lufs -14 --post-aac-peak -2.0 # continuous animation: freezedetect + post-AAC peak (for reading holds or static talking heads, pass --static instead of --min-liveness/--max-freeze; add --beats beats.json for sync)
Look at the sheet and listen through once. Then tell your user the path, the length, what you cut and why, and anything you couldn't fix. Say which footage is AI-generated.
references/long-recordings.md (opens in a new tab)references/recipes.md (opens in a new tab)references/slop.md (opens in a new tab)scripts/check_sync.py (opens in a new tab)scripts/check_video.py (opens in a new tab)scripts/clean_voice.py (opens in a new tab)scripts/contact_sheet.py (opens in a new tab)scripts/cut_reel.py (opens in a new tab)scripts/duck_mix.py (opens in a new tab)scripts/review_media.py (opens in a new tab)scripts/spot.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub students-of-local/hildegard --plugin hildegard17 skills in this plugin
/hildegardUse for /hildegard, /art, /vus, /mus, /suno and any request to make, edit or write creative work; routes images, video, sound, music, 3D, games, web and every kind of writing./hildegard-3dUse when making a 3D model, sculpture, figurine, game asset, relief or lithophane in Blender, OpenSCAD or code, checked each round for views, watertightness and size./hildegard-artUse when making art, an image, illustration, key art, mood board or visual style with the user's image model; posters and covers with words go to hildegard-design.Other plugins' skills for the same job