Edit a course talking-head video
The course talking-head is the most common knowledge video: an instructor talks to the camera or a microphone, and the picture moves between the instructor, slides and screen recordings. Viewers want to hear clearly, follow easily and not wait. This recipe delivers a course video ready to publish, for course chapters, knowledge sharing and product walkthroughs.
This is a scene recipe: it says how this kind of video is cut well; parameters for every call are in the Cut script reference.
When to use this recipe
Use it when the request mentions an online course, lesson, lecture, teaching, talking-head explanation, knowledge sharing, screen-recording or slide walkthrough, or an instructor shot.
Two kinds are easily confused with it: a single monologue with no slides that should be tight — use talking-head cleanup; highlights from a long class for short videos — use long video to shorts.
What a good result looks like
| Aspect | Standard |
|---|---|
| Pacing | Remove fillers, repetitions, restarts and pauses over 0.6 s; keep 0.2–0.4 s of breath at each cut. A lesson needs breathing room; no jump-cut compression |
| Picture | Cut to the slide or screen recording while it is being explained; when there is an instructor shot, keep the instructor picture-in-picture in the bottom right (about a quarter of the frame width); return to the instructor full frame for the opening, conclusions and examples |
| Captions | Chinese subtitle conventions: no sentence-final punctuation, inner commas become a space; at most 20 characters per line landscape, 12 portrait; 1–6 s each; break at pauses, never across a cut |
| Sound | Clear voice, about -14 LUFS overall (the export normalises); background music about 18 LU under the voice, ducked another 6–10 dB under speech |
| Structure | Say what the lesson is about within the first 5 seconds; a 1–2 s title card may mark a chapter change |
| Cover | The first frame is not black |
Steps
Run the code below in codemode. Editing scripts go through praxis.cut.projects.execute({ body: { script } }); times inside scripts are seconds.
1. Media and transcript
Put the lecture recording or instructor video and the slide images or screen recording in one media library. The transcript uses the asset’s topic to fix homophone errors: write the topic into the narration asset’s context, then transcribe it again:
await praxis.media.libraries.assets.update({ path: { library_id: libraryId, asset_id: voiceId }, body: { context: { topic: "Lower secondary maths: completing the square" } },});await praxis.media.libraries.assets.reprocess.create({ path: { library_id: libraryId, asset_id: voiceId }, body: { kinds: ["transcript"] },});For a lesson with many technical terms, add them to the library’s hotwords. While the transcript runs, the asset’s processing.stage and processing.progress show where it is; edit once processing.state is ready.
2. Project and rough cut
const project = await praxis.cut.projects.create({ body: { name: "Lesson 3: completing the square", settings: { width: 1920, height: 1080, fps: 30 }, bindings: [{ library_id: libraryId, name: "course", access: "read_write", default_upload: true }], },});Give the user the project’s console_url as it is. The rough-cut script places the voice first, then the slides. Track layers: index: 0 is the top layer, and a track added without index goes to the bottom; reorder later with MoveTrack(id, index).
const voice = AddTrack("audio", { name: "Narration", role: "voice" });const talk = Insert(voice, { type: "audio", media: { libraryId, assetId: voiceId }, start: 0, sourceIn: 0, length: "auto" });const slides = AddTrack("video", { name: "Slides" });Print({ talk, slides });3. Remove fillers, repetitions and pauses
List first, then delete:
Print(RemoveFillers(talk, { dryRun: true, minConfidence: 0 }).items.slice(0, 20));RemoveFillers(talk, { keepPauseMs: 300 });RemoveFillers deletes the fillers, verbal tics, repetitions and restarts labelled in the transcript, by default only those with confidence 0.7 or more (items at 0.6 in the list are word-list guesses: confirm the words the user named in context and delete them with DeleteWords); the deletion applies to picture and sound on every track and to the captions generated from this narration. For a slip that is not labelled, find its words with GetTranscript and delete them with DeleteWords(talk, words). Find pauses over 0.6 s with GetAnalysis(ref, "silence"): it returns source time in microseconds, so convert to seconds and pass the ranges to DeleteWords as well (it takes any source-time range and maps it onto the current timeline). Do not use RippleDeleteRange, which takes timeline time: removing fillers has already moved the timeline.
const pauses = GetAnalysis({ libraryId, assetId: voiceId }, "silence") .map(p => ({ start: p.from / 1e6, end: p.to / 1e6 }));DeleteWords(talk, pauses, { keepPauseMs: 300 });4. Slides follow the explanation
With GetTranscript, find the sentence that introduces each slide, place the slide where that sentence starts and keep it until the next slide. Slides that are images use type: "image". With an instructor video, put the instructor on the track above the slides and scale it into the bottom right: transform: { scale: 0.28, x: 0.84, y: 0.82 } (x and y are the relative centre of the frame); to go back to the instructor full frame, split the clip and set scale: 1 on the second part. When the instructor video and the screen recording started at different times, call GetTranscript on each, find the same sentence in both and subtract the two start times: that is the offset. The one that started recording first gets the offset as its sourceIn (and so does the instructor’s matte, if there is one), and both start at 0 on the timeline. If the screen recording also captured the instructor’s voice, mute the recording’s track, or you will hear an echo.
4a. Lay the instructor over the slides (no green screen)
When the instructor was filmed against an ordinary background and should stand on the slides (rather than sit in a box with their room behind them), first make a black-and-white matte video (person white, background black), then use it in Cut as a luma mask:
const job = await praxis.media.assets.edit({ path: { library_id: libraryId, asset_id: lecturerId }, body: { operation: { type: "remove_background", output: "mask" } },});// Poll praxis.media.libraries.jobs.retrieve({ path: { library_id: libraryId, job_id: job.id } })// until status is completed; the matte is outputs[0].asset_id, a new derived video asset.The matte lines up with the instructor video frame for frame: give the matte clip and the instructor clip the same start, sourceIn, length, fit and transform, and point the instructor clip’s mask at the matte’s track. The matte track itself never shows in the picture:
const lecturer = AddTrack("video", { name: "Instructor", index: 0 });const matte = AddTrack("video", { name: "Instructor matte" });const place = { start: 0, sourceIn: 0, length: "auto", fit: "contain", transform: { scale: 0.42, x: 0.77, y: 0.74 } };Insert(matte, { type: "video", media: { libraryId, assetId: matteId }, ...place });Insert(lecturer, { type: "video", media: { libraryId, assetId: lecturerId }, ...place, mask: { source: { kind: "track", trackId: matte, channel: "luma" } } });Put the instructor where the slides leave room (usually bottom right), never over a title or a formula. Matting is billed by the seconds of the instructor video (a started second counts as one), and a 1080p video takes about two to three times its own length. Matte first, then remove fillers as in step 3: DeleteWords and RemoveFillers delete ranges of the timeline, so the instructor and the matte are cut together and stay aligned.
5. Captions
const subs = AddTrack("caption", { name: "Captions" });AddCaptionsFromTranscript(subs, talk, { style: { preset: "subtitle-outline" } });Text that is mostly Chinese follows subtitle conventions by default: no sentence-final punctuation, inner commas become a space, breaks at pauses, snapping to cuts, short captions merged; the adjustments are listed in a CAPTION_ADJUSTED warning. subtitle-outline is white text with a black outline and no background block, which suits light slides. Check proper names after generating.
6. Look, listen, export
Look at four moments with praxis.cut.projects.frames.list (include second 0: the cover must not be black); measure mix with praxis.cut.projects.analysis.create to see whether music covers the voice. Export with praxis.cut.projects.exports.create. The export’s checks are the platform’s own review: when CAPTION_TEXT_MISMATCH (captions and sound disagree), CAPTION_DRIFT (captions and speech out of step) or FILLER_REMAINING (fillers left) appears, fix it and export again; SUSPECT_TYPO lists words the transcript was unsure of, so check each one and correct the caption text where it is wrong.
Tiers
| Tier | Includes | Done when |
|---|---|---|
| Draft | Rough cut, fillers removed, captions | The draft plays end to end |
| Standard (recommended) | Draft plus slide switching, a topic statement at the start, one look at frames and one mix measurement | The export’s checks contain no caption or filler problems |
| Fine | Standard plus instructor picture-in-picture, chapter cards, lip sync and captions checked passage by passage | The user approves each passage |
Common mistakes
- Caption deleted, sound still there: the caption text was edited without deleting its sound. Always delete with
RemoveFillersorDeleteWords, which remove picture, sound and caption together. - Screen recording covers the instructor: new tracks go to the bottom by default; put the instructor’s picture-in-picture track on top with
index: 0orMoveTrack. - One long caption bar with punctuation everywhere: keep the default subtitle conventions; do not merge captions by hand into long sentences.
- Homophone errors (such as 备课 recognised as 背课): write the asset’s
context.topicbefore transcribing and put terms in the hotwords. - Lips and captions out of step: do not move caption times by hand and do not transcode to another frame rate first; generate captions from word times with
AddCaptionsFromTranscript. - Grey preview for high-bitrate phone footage: wait for the preview proxy; the editor shows “预览生成中” until then.
- Matting asked for a transparent video (
output: "alpha"): a transparent ProRes video is very large (about 870 MB per 15 seconds of 1080p), so a whole lesson’s may fail or crawl; laying the instructor over slides needs only the black-and-white matte (output: "mask"). - The mask points at the wrong thing:
mask.source.trackIdis the id of the matte’s track (whatAddTrackreturned), not the matte asset’sassetId; onINVALID_MASKfix this, do not matte again, once is enough. - Instructor and matte out of line: both clips need exactly the same
start,sourceIn,lengthandtransform, so change one and you change both; positions are relative (xandybetween 0 and 1), and pixel values move the person off the frame.
Next steps
- Clean up a talking-head clip: when you only need fillers and pauses removed, use this shorter one.
- Cut shorts from a long video: turn one lesson into several shorts that stand alone.
- Exports: set the output, track the job and locate failures.