Takes video edit
Takes cuts the takes (rough_cut, cut_take) and builds each version of the edit from a recipe
(render_edit, publish_edit). ffmpeg/ffprobe are for stills and picture layers. Exact commands
are in references/ffmpeg-recipes.md. Title cards, lower thirds, animated captions and other motion
graphics are HyperFrames compositions: see Motion graphics.
The one rule
A command that ran proves nothing about how it looks. Text truncates, fonts fall back, captions land late, crops cut off heads, all without an error. After any cut, crop, text or grade change, render stills (first frame, last frame, the longest caption, the tightest crop) and look at them with the Read tool before you call the edit done.
Start from the Takes session
Use the takes MCP, not file guessing. Follow the user's rules: what you learned from their
comments on earlier videos. get_session and next_path give them (the rules key) the first
time in a chat; get_rules area=edit,thumbnail gives them all. A rule the user wrote (by_user) wins.
get_sessiongives the script, every take (file path, duration,keeperstar, the script variant and hook it was read with), every asset, the folder rules,warningsandopen_comments. Fix anywarningsabout files in the wrong place.- Edit the keeper (the starred take). No star: ask which take. Do not pick one yourself.
A recording made outside Takes (phone, QuickTime, a download): add it with
import_takefirst. Never editsession.jsonby hand. - Camera + screen takes: both files of one take share a number. Both carry the mic, so line them up by their audio if they drift.
stills/andassets/belong to the user. Read them, never write there.stills/holds frames the user saved from a take: try them first for the thumbnail.- Style: call
get_library session=<session>before you design captions, a thumbnail or a title. Use itstokens(colours, type) andtemplateif the user picked a style. No style: use plain, readable defaults (see below). - Music and sound effects: mix them into a new version of the edit with ffmpeg, under the
voice. Takes plays only the file: it never adds a song or an effect while a video plays, so
what the user hears is what posts. Find files with
list_music(tagnarrows it to the user's tags, such as Education; tag new finds withtag_sounds). The Sound page's Use button sends you the file, and for an effect the video and second. No song asked for: suggest two or three fromlist_musicand ask first. Nothing fits, or the user describes a song:make_musicmakes one with ElevenLabs (seconds = the edit's length) into the Made tab; one track per ask, and say the credits it used. Clicks in a screen recording get the real mouse click of the click ring effect (list_effects click-ring), not a click made in code. - Find footage by meaning:
search_mediasearches the whole library on this Mac: clips by what they show ("walking outside", "close-up of a phone"), stills, and the words in transcripts ("where I talk about pricing"). Hits havepathand, for video and speech,atin seconds. Use it for b-roll and cutaways before you ask the user to film something.
Build and publish a version
An edit is a recipe (JSON) that Takes keeps beside each version: edits/<name>-vN.recipe.json. Takes
renders the recipe. You change the recipe. So a new chat, or the same chat after a week, builds the
next version from that file, not from memory.
- First version:
rough_cutgivescut. Callrender_editwithrecipe={name, cut, frame, music, sfx, over, steps, cover}andwait_s=120. Leave out what you do not need. - Next version:
render_edit base=<name> changes={...}. Change only what the comments ask for. A list replaces the whole list: repeat the whole music entry when you change one value. Readchangedin the result: it lists every value that changed. - Graphics and captions: put the composition in
_edit/<name>/, add its render command tosteps, and its output (with alpha) toover. Captions read_edit/<name>/words.json. - If the job is not done:
get_job id=<id> wait_s=50. Then grab 3 to 5 frames of the render and look at them. publish_edit render=<id> note="<what the viewer notices>" replies=[...]. It saves the version and its recipe, moves the posts and answers the comments. The checks already ran in the render.- Never mix a finished edit into a new one. Never clean the voice twice.
Times in over, music and sfx are seconds of the cut; a cover adds its 0.1 s by itself. Music and
sound effects come from list_music (@library/... paths). get_edit_recipe shows any version's
recipe and the versions before it.
Cut a talking-head video
Takes makes each take ready to edit when it saves it: word times on the video clock
(get_session → each take's edit_ready). Cut takes with rough_cut and cut_take by default:
they fix the take's audio offset (0.16–0.24 s on a camera take) and its frame rate.
When you need what they cannot do (a J/L cut where sound and picture cut at different points, a
speed change, a frame cut inside a word, an effect), use your own ffmpeg. Start from cut_take's
synced _work clip and .wav, or from the take with the audio_offset_s that get_session shows
(see "Audio by hand" below). Tell the user what you did.
- First cut:
rough_cutwith the session (optionaltakes,gap). It keeps each script line once (the last full try) and drops false starts, stutters, ums and long pauses. It returns the clip,cut(the segments),dropped(each withwhy) andmissing(script lines that no take has). Show the user the clip withopen_in_appand tell them in plain words what you dropped and what is missing. The rough cut is only a first draft: improve it freely. - Any other cut:
cut_takewithsegments: [{take, in, out}], seconds of the take. To change the rough cut, edit itscutand send it tocut_take. A cut point inside a word moves to the word's edge (moved). The clean voice goes in whenclean_voiceis done. - Both write
_work/<name>-vN.mp4, a voice-only.wavand a.words.json(word times in clip time). A long cut returns a job:get_job wait_s=50gives the same result. _work/is a working folder. The cut you keep goes into the recipe'scut:render_editbuilds the version (see above). Then look at stills of it.
Slow steps run as a job. The final ffmpeg encode, a HyperFrames render, Demucs and Whisper
take minutes: start each one with run_job (cmd with paths relative to the session, outputs
from next_path, a short label), never as a background Bash job or with sleep. If it ends
within about 2 min, wait with get_job wait_s=50. Else tell the user in one line what runs and
end your turn: Takes tells you when it ends, and you go on from there (stills, check_edit,
open_in_app). Quick steps (a still, an ffprobe) stay in Bash.
Voice
Call clean_voice with session and take (optional strength 0–1, loudness normal
= −14 LUFS or quiet = −18 LUFS for a video with music). It runs in the background. When
get_session shows voice.file under the take, use that WAV as the take's audio instead of the
audio in the .mov (cut_take does this for you). It already has noise removal, EQ, compression and loudness. Do not compress it
again: a second compressor lifts the room echo after every word. Only trim, fade and mix it.
render_edit uses the clean voice. Do not process it.
Keep every intermediate audio file as float WAV (pcm_f32le). Integer WAVs clip peaks over
0 dBFS, which sounds like clicks.
New words, voice-over, other voices (ElevenLabs)
These tools need an ElevenLabs key in Takes › Plugins › Voices. When a tool says there is no key, tell the user to open that page. Each call costs ElevenLabs characters (about one per letter), so make one call per ask.
- Fix what was said:
fix_wordswithtake(orfile),old(the words exactly as said; the transcript has them) andnew. Takes says the new words in the voice, using the sentences around them so the tone matches. It cuts them in at the word edges, using the take's cleaned voice when there is one. When the new words fit the old time (0.8–1.25×), the result is the same length as the take, with a.wavand an.mp4, so your cut list still holds. If they do not fit, there is only a WAV, and the result says how far everything after the fix moved. The lips do not move with the new words: tell the user when the fix is on camera, and offer b-roll over it. - Voice-over:
voiceoverreadstext, or by defaultscript.md. It writesgenerated/<name>-vN.wavat −14 LUFS. Treat it like a cleaned voice: trim, fade and mix it, but do not compress it again. - Another voice:
change_voicesays a take or a part of it (start/end) again in another voice, with the same words and timing. - Voices:
voicetakes a name or the start of one. Leave it out to use the default voice the user picked.voiceslists the voices, andvoices search=...finds voices in the ElevenLabs library.design_voicemakes three samples from a description for the user to choose from.
Cut
The result of your cut goes into the recipe's cut. rough_cut and cut_take put each cut at a word edge, keep pauses up to gap (0.25 s by
default), fade 8 ms at each cut, keep the voice in sync and give a constant frame rate. What is
left for you:
- Read the clip's words against the script. The clip's
.words.jsonhas them. A missing word: move that segment'sinoroutand runcut_takeagain. - Pauses: about 0.15–0.25 s between sentences. Keep at most one long pause for effect.
- Look at a frame at each cut before you build on the clip.
- Audio by hand: if you take sound out of a take yourself, add
-af aresample=async=1:first_pts=0. Plain-vndrops the take's audio offset and puts the voice 5 frames early. A cleaned voice withvoice.starts_at_singet_sessionstarts that much after the video: delay it by that much.
Motion graphics (HyperFrames)
Takes installs the HyperFrames skills (HeyGen, Apache-2.0) with this one: Plugins › Skills › HyperFrames. A composition is an HTML file that HyperFrames renders to video, frame-exact. This skill owns the edit; HyperFrames makes only the layers that go over it.
- Not installed (no
hyperframesskill): tell the user to switch on HyperFrames in Takes › Plugins › Skills, then go on with plain ffmpeg text for now. Rendering needs Node.js (npx). - Style first:
get_library session=<session>gives the style's tokens (colours, fonts) and its saved parts (title cards, lower thirds, captions). Start from a saved part when one fits. Write new ones in the style's tokens. - Where: the composition goes in
_edit/<name>/. Read thehyperframesskill before you write its HTML. For captions, read the word times from_edit/<name>/words.json. - Render with alpha so the footage shows through:
npx hyperframes render --format mov --quality looks --output <file>.mov(or--format webm). Put that command in the recipe'ssteps({run: [argv], cwd: "_edit/<name>", makes: [file]}) and the file inover({file, at, alpha: true}).render_editruns the step and lays the layer over the cut. - Never open the user's screen:
npx hyperframes preview --background --no-open. Look at stills of the render, not at the Studio. - Effects, only on request: Takes ships ready-made effects (over-the-shoulder cards, glass graph,
freeze-frame sticker, tier list, text behind, colour grade, a camera bubble that steps aside in pauses)
on the Styles board. Use one only when
the user names it or asks for one:
list_effects effect=<slug>gives its README and source. Copysrc/into_edit/<name>/and change the copy; set its frame (data-width/data-height) to the edit's size, since each effect lays itself out for 9:16, 4:5, 1:1 or 16:9. Never add an effect by yourself, and do not let them shape a design the user did not ask for. Asked for ideas, you may name one that fits. - Keep what works: after the user likes a part,
save_to_librarywith the render, a one-linenoteandsource_dir(the composition), so the next video starts from it.
Fast full-picture renders and 3D (Raea, optional)
Raea (Plugins › Skills › Raea, off until the user switches it on) renders React/TypeScript
compositions on the GPU without a browser. Read the raea skill before you write one (raea-bevy
for 3D). HyperFrames stays the default for layers over the cut. Use Raea only when one of these is true:
- Heavy graphics over long footage: a minute or more of captions, cards and lower thirds over a talking head. HyperFrames screenshots every frame of the footage in Chrome; Raea decodes it on the GPU (19 s of 1080x1920 with captions: 4.3 s against 19.7 s). Short or footage-free graphics are no faster in Raea: use HyperFrames.
- Real 3D: extruded type, product turntables, lit scenes, splats.
- The user asks for Raea.
Raea has no transparent output (a transparent background renders black), so it makes the
whole picture, not a layer. The composition plays the same cut clip the recipe uses
(<Video muted src=...> on the _work/ clip from cut_take or rough_cut) with the graphics on
it. Render it as a step ({run: ["raea", "render", "edit.tsx", "-o", "picture.mp4"], cwd: "_edit/<name>", makes: ["picture.mp4"]}) and lay it in over without alpha ({file, at: 0}), so
it covers the cut while render_edit keeps the voice, music, sound and loudness. Check stills of the
render as always. Not installed (no raea command): tell the user to switch on Raea in Takes ›
Plugins › Skills; never run raea's own installer.
Reframe, grade, captions
- 9:16 reframe: crop around the face, not the frame centre. Keep head and shoulders in every
frame, never cut the top of the head or the chin. Check stills at several points in the take.
A 9:16 cut gets its own name (
<slug>-vertical). - Grade: stay close to the raw footage. Small contrast and saturation changes at most.
- Captions: build them from the word times of the final edit, not the raw take. Short lines
(2–5 words), sentence case, a bold sans-serif font, white with a dark outline or shadow, in the
lower third and clear of the face. Each line appears on its first word. Burn them with the
subtitlesfilter, or deliver an.srtif the user wants platform captions. - Loudness: final mix at about −14 LUFS, true peak at or below −1 dBTP. Music sits well under the voice and ducks while the user talks.
- Final mux: add
-map_chapters -1 -dn. Some music files carry chapter tracks that make the video report the wrong length.
Order that works: cut, then reframe, then grade, then audio, then captions.
Where files go
Always get the path from next_path. It picks the folder and the next version number.
- Edits:
render_edit+publish_editwrite<session>/edits/<slug>-vN.mp4and its recipe.next_path kind=edit name=<slug>gives the path for an edit you make by hand. Videos only. - To finish in another editor (Resolve, Premiere, Final Cut), on the user's ask:
export_edit edit=<slug>-vNwrites.fcpxml,.premiere.xmland.edlnext to the version. Tell the user what itsleft_outlists. - Thumbnails:
next_path kind=thumbnail name=<slug>gives<session>/thumbnails/<slug>-vN.png. For several options, add an option word to the name (<slug>-closeup). Never put them inedits/. - Never overwrite a version, and never write to or rename a take file. Every change is a new version.
- Save the transcript of each version as
edits/<slug>-vN.words.json. - Keep scratch files (cut lists, intermediate WAVs) in a temp folder, not in the session.
- Cover: if the post's front matter (
posts/linkedin.md) hascoverset, put that image in the recipe'scover: every new version starts with it as its first 0.1 s.
Thumbnails
Start from stills/. Otherwise pull candidate frames from the edit (a contact sheet helps) and
pick a sharp frame with eyes open and a natural expression, never mid-word. Add at most a short
title in the style's fonts. Look at the result at small size, the way a feed shows it. Offer
several options when the user did not ask for one specific look.
After a new version
publish_editputs the new version on the posts that showed the one before (a version the user picked stays) and opens it in the app. For a post of another shape,set_postwithmedia:platform: "vertical"for 9:16,platform: "youtube"for a long 16:9 edit. Only changemedia; keep the user's post text.render_editrunscheck_editon every render: it compares the edit with the take (sound, picture, sync, words and past fixes). Fix every problem before you publish. Runcheck_editon an edit you made by hand. Do not judge sound by listening with a model: the checks measure it. With a Gemini key, Gemini also watches each version next to the user's rules (about 5 cents);publish_editandcheck_editreturn it asreview. Its problems are a view, not measurements: look at the frame of each one, then fix what is real in the next version. Without a key,reviewgives a frame sheet: read it and check each frame against the rules yourself.- For an edit you made by hand:
open_in_appwith the new file's path, once per finished version. It never takes focus. - Never open files or apps on the user's screen yourself (no
open, no QuickTime).
Review comments
The user reviews edits in Takes with comments on a time range and an area of the frame, on an
image area, or on selected script text. get_session shows open_comments.
get_commentsreturns each comment withwhen(start/end seconds),area,said(the words there, from<stem>.words.json) and aframePNG with the area outlined. Read every frame PNG. The outline shows what "this" means.- Fix all of them in one new version:
render_edit base=<name> changes={...}, thenpublish_edit replies=[{id, text, lesson}]answers them with the new version. - For an edit made by hand, one
reply_commentcall:replies: [{id, text, resolve: true, fixed_in, fixed_at, lesson}].fixed_inis the new file,fixed_atthe second where the fix shows. One line of text each. If a comment is unclear, ask a question and leave it open.lessonsays what the comment taught: the id of a rule fromget_rulesthat already covers it (the same mistake again),"new"withrule: {area, text}when it holds for the next videos too, or"one-off". Keep rules few and short (one sentence, 10 per area; longer words go indetails): sharpen a rule withset_rulebefore you add one. When an area is full, give the new rulemerge_into(the closest rule) andmerged(one sentence for both): the user approves the merge on the Feedback board. When a rule comes back again and a number can test it (loudness, peak, pauses, length), give it acheckwithset_rule. - Script comments: fix with
update_sessionorupdate_variant, then reply.
When it is live
When the user says the video is posted, call set_published with session, platform and
url, once per platform. Do not delete session files yourself: the user cleans up in the app.
Report back
- The path of the new file in
edits/and its length. - That caption wording needs the user's check: speech recognition can mishear words.
- Any text you added on screen that the user did not say.