1. Positioning and Workflow
This skill is a self-contained video narration and editing production pipeline that combines video understanding, storytelling, clip selection, narration writing, voiceover synthesis, and audio-video mixing in a single working directory work_dir:
understand.py (video understanding)─▶ Agent creates story/audio-visual plan and writes clip_plan.json or narration.json ─▶ [cut.py (clip and re-export briefing)] ─▶ validate.py (local baseline validation) ─▶ voiceover.py (TTS voiceover) ─▶ assemble.py (mixing and subtitle rendering)
For daily use, directly run the main entry point scripts/recap.py to chain the full workflow, which will automatically pause at creation nodes. You can also call individual stage scripts under scripts/ (understand.py, cut.py, validate.py, voiceover.py, assemble.py) as needed.
Deconstructing an external finished video into a production reference (production_reference.json) is not on the default production chain. When the user asks to deconstruct a sample for learning: first run understand.py on the sample (recommend setting ASR_SEGMENT_SECONDS=5), then use a separate deconstruction skill to perform measurement, annotation, validation, and export. Place the exported production_reference.json into the next run's work_dir, or register it as a production_reference template in the resource library and bind it via --project. The main workflow will not automatically deconstruct videos, nor will it mechanically compare new finished videos against reference videos for scoring.
The full workflow supports resume from breakpoints: after writing clip_plan.json or narration.json, simply re-run the same recap.py command to continue. Upon resuming, the script will verify the source video identity and parameters recorded in recap_run_manifest.json; if the working directory comes from a different video or parameter combination, it will refuse to reuse it. When paused, the resume command printed in the terminal will have the path converted to an absolute path and will include --work-dir.
The visual pipeline --edit-mode full|cut and the audio strategy --audio-mode narration|source-mix are independent of each other, supporting the following five routes (other combinations will immediately report an error):
| Input | --edit-mode | --audio-mode | Agent Pause Point | Workflow | Details |
|---|---|---|---|---|---|
| Single Video | full | narration | 1 time: write narration.json | Understand → Write Script → Validate → Voiceover → Mix | §4 |
| Single Video | cut | narration | 2 times: first write clip_plan.json, then after clipping write narration.json for the output | Understand → Clip → Re-export Output Time Brief → Write Script → Validate → Voiceover → Mix | §4 |
| Multiple Videos | cut | narration | 2 times: same as above, and each clip must have a source_id | Understand per source → Clip → Write Script → Validate → Voiceover → Mix | §4.5 |
| Single Video | full | source-mix | No pause | Directly mix the current entire video segment (without understanding or TTS) | §4.7 |
| Single / Multiple Videos | cut | source-mix | 1 time: write clip_plan.json | Understand → Clip → Mix (no narration writing) | §4.7 |
2. Creative Responsibilities
The Agent is responsible for creative judgments. Before starting, distinguish the current round's creative control mode (CREATE new creation / DIRECTED execute according to a specified plan / REVISION finalize and revise, independent of --edit-mode), and complete five judgments before voiceover and rendering:
- Directorial Judgment: Clearly define what the audience clicks to see, whose point of view (POV) to follow, what the core suspense is, where the emotion starts and ends, and which card is kept for the final reveal.
- Story Editing: Ensure each beat clearly conveys a substantive change in the situation, relationships, or stakes; do not write a log-type summary.
- Visual Editing: Select shots and in/out points with action progression and character reactions; delete dragging transitions.
- Audio/Narration: First determine whether each beat is dominated by visuals, original dialogue, action sounds, silence, or narration; then write the script following the principle of "pad half a sentence, let half a sentence, continue half a sentence".
- Audience Review: Watch from the perspective of a first-time viewer, checking the visuals without narration, listening to only the audio with eyes closed, and verifying the beginning and end.
For details on control mode division, REVISION locking rules, clip and voice-over specifics, and the structure of recap_story_plan.json, visual_audio_board.json, and style_card.json, see references/creative-editing-playbook.md.
3. Environment and Remote Call Instructions
# ffmpeg: brew install ffmpeg | apt install ffmpeg | choco install ffmpeg
export MIMO_API_KEY=***
A single MIMO_API_KEY can drive the entire default chain. Components involving remote network requests are as follows:
- Video Understanding (
understand.py): Sends segmented audio windows to MiMo ASR (mimo-v2.5-asr), and sends frame JPEGs along with thebackground_research.jsonsummary to MiMo VLM (defaultmimo-v2.6-flash, switchable tomimo-v2.6-proetc. viaMIMO_MODEL). If the working directory already has complete analysis artifacts, passing--brief-onlyor--edited-storyboard-onlywill run locally without initiating network requests. - Narration Voiceover (
voiceover.py): Sends narration text to the corresponding TTS service according to--tts-provider(defaultautopreferentially selects configured MiMo, then Fish Audio, does not automatically selectindex-tts):mimo-tts: Sends to MiMo TTS (mimo-v2.5-tts); if--voice-ref <audio>is explicitly passed, that reference audio clip is also sent tomimo-v2.5-tts-voiceclone(please confirm voice authorization before use).fish-audio: RequiresFISH_API_KEYconfiguration; sends each narration text segment andFISH_TTS_REFERENCE_IDtoFISH_TTS_API_URL(defaulthttps://api.fish.audio/v1/tts).index-tts: Enabled only when--tts-provider index-ttsis explicitly specified; sends text andINDEX_TTS_VOICEto the user's self-hostedINDEX_TTS_ENDPOINT(seereferences/index-tts.mdfor details).
- Narration Validation (
validate.py), Video Clipping (cut.py,shot_review.py), and Audio-Video Mixing (assemble.py): Pure local deterministic logic andffmpeg/ffprobecalls; no network requests are initiated.
Token Plan keys starting with tp- are sent to the China region cluster by default; you can switch clusters via MIMO_TOKEN_PLAN_CLUSTER. Configuration details can be found in references/config-playbook.md, and artifact formats in references/data-schema.md. Hereinafter, scripts/... paths are relative to this skill's directory.
4. Creation and Production Workflow
4.1 Background Research and Video Understanding
As soon as a movie name, episode name, or scientific topic can be identified from the filename or user description, before starting, verify character relationships and prior plot according to references/research-guide.md, and write them to work_dir/background_research.json (for multi-video clips, write to the project root work_dir, and the script will automatically sync to sources/<source_id>/).
Then start the orchestration entry point:
python3 scripts/recap.py <video> --work-dir <work_dir> --context "Background"
After the script completes audio extraction, silence and sentence-ending pause anchor detection (speech_boundary_anchors.json), scene segmentation, VLM frame analysis, and ASR transcription, it generates a storyboard montage storyboard/storyboard_*.jpg and a creation brief agent_narration_brief.md, then pauses.
4.2 Directorial Intent and Shot Selection Plan (cut Phase 1)
After reading agent_narration_brief.md and reviewing the storyboard frames, first write recap_story_plan.json (write 1 selected plan when the CREATE main line is clear; only compare 2–3 candidate hypotheses if the source material has multiple angles to consider) and visual_audio_board.json (specify the visual moment, in/out reason, original sound anchor point, and audio dominator for each beat).
In the first phase of cut mode, write work_dir/clip_plan.json based on the source video timeline (SOURCE) (do not write narration.json at this stage):
{
"target_duration": "3m",
"clips": [
{
"start": 12.0,
"end": 38.0,
"reason": "b01 (hook): Shen Man pushes the door open and catches her fiancé discussing an arranged marriage with a wealthy heiress. The in point catches the moment she pushes the door and sees the two of them; the out point catches her turning around and clutching the household registration booklet."
}
],
"required_evidence": {
"nodes": [
{"id": "e1", "source": "/abs/source.mp4", "start": 14.2, "end": 18.6, "track": "video", "content": "Pushes door open and catches them embracing"}
],
"before": []
}
}
Rules for shot selection and cut points:
- Concise Clipping Reason (
reason): Use natural language to clearly describe the beat function this segment serves (hook | setup | turn | escalation | payoff) and the visual/audio basis for the in and out points; no need to assemble a fixed number of segments in a vertical bar template. - Mandatory Visual and Original Sound Evidence (
required_evidence): Critical actions, reactions, or original Q&A that must not be lost can be registered inrequired_evidence; if boundary snapping cuts out a mandatory range or reverses thebeforeorder, the script will report an error and block. - Late Entry vs. Cold Open: Default to sequential "late entry" (cut directly into a conflict or contrasting action, skipping the setup and pleasantries); if the main conflict appears late in the linear order, a cold open suspense shot can be placed at the beginning, its duration naturally ending with the suspenseful action. Ensure it is understandable without setup, does not repeat the same camera angle from the main film, only leaves suspense without revealing the ending card early. When narration lowers the original sound, prioritize reaction shots, action details, or steady-state visuals; avoid continuous close-ups of characters speaking while their dialogue is being lowered and muted.
- Safe Sentence-Boundary Cut Points and Final Breath: Cut points must fall at the beginning/end of the source, sentence-ending pause anchors, silence windows, or seamless joints within the same source. Sentence-boundary snapping will reserve a maximum of
0.30sbreath within the pause window without crossing hard cut points; each segment minimum>= 0.8s; leave room for the final beat's expression or action to settle. Cutting into the middle of dialogue will reportunsafe_clip_sentence_boundary(if it causes both flash frames and cut-word conflicts, it will reportshot_speech_conflict). - Dense Fast Cuts and Fragmented Shot Detection: After
cut.pyrendersedited_source.mp4, it will automatically runshot_review.pyto generateshot_review.json, intercepting extremely short residual shot flash frames<= 0.20s(flash_slivers). When dealing with action scenes or dense shot-reverse-shot patterns, you can also runffmpeg -i <video> -vf "select='gt(scene,0.35)',showinfo" -f null -orscripts/shot_review.py(seereferences/shot-review.md) to check cut points, distinguishing between source-native and spliced cut points—delete entire irrelevant short shots from the source or move boundaries outside dense cut clusters; for cut points created by this splicing (e.g., a few residual frames from an adjacent shot at a hard cut edge), expand the in/out points or merge adjacent segments from the same source; do not use transitions to mask bad joints.
After writing clip_plan.json, re-run recap.py. The script will perform boundary snapping, render a constant frame rate edited_source.mp4, and remap the output timeline evidence (speech_boundary_anchors_output.json, storyboard/edited_storyboard.*), then pause, waiting for the narration script.
4.3 Narration Script and Original Sound Space Creation (full / cut Phase 2)
Upon entering the script-writing phase, first review the post-clip storyboard, fill in the visual_audio_board.json with the output time, and write style_card.json as needed. Then write work_dir/narration.json:
[
{
"start": 0.2,
"end": 5.0,
"narration": "After five years together, Shen Man took the household registration booklet and went to propose. Pushing open the door, she caught her fiancé embracing a wealthy heiress, discussing an arranged marriage.",
"pause_after_ms": 250,
"overlaps_speech": true
}
]
**In cut mode, narration.json directly fills in the OUTPUT timestamps of the post-clip finished video (0 .. total duration) ** (call the validator separately with validate.py --mode cut_output). Core writing requirements (details and examples are in references/creative-editing-playbook.md):
- Background, Stakes, and Naming Pace: Explain the prior relationships, motivations, stakes, and consequences of actions; do not restate what is visually obvious. Name 1–2 core characters in a short video within 60 seconds; for secondary characters, refer to them by their relationship or role. In 3–10 minute medium-length narrations, naturally introduce key characters as the beats progress.
- "Pad half a sentence, let half a sentence, continue half a sentence" and Original Sound Boundaries: Stop speaking early before important original dialogue or key action sounds to give way, and after the sound has fully settled, continue with half a sentence to reveal the consequence. When lowering the original sound and cutting in (
overlaps_speech: true), it must align with a sentence-ending anchor or silence window (failure will reportinterrupts_source_sentence/unsafe_source_handoff). Releasing the original sound should also avoid landing in the middle of a character's half-sentence (if no anchor point exists within the subsequent 3 seconds of the dialogue interval, a review promptunsafe_source_releaseis given; the mixer performs abounded_releasesmooth ramp-up). - Word Budget, Complete Sentences, and Avoid Cliches: End each segment with a complete sentence's punctuation mark (incomplete sentences report
incomplete_sentence). Match the window with precise word count (infullmode, exceeding the budget by 1.25x reportsover_budget, but words are not silently deleted). Write coherent, natural, conversational long and short sentences; do not write reading-comprehension-style elevated clichés. Entrust the ending to the visuals and original sound to play out; after delivering, do not add a concluding narration. - Background Music and Original Sound Space Subtitles: Use only instrumental music for external background music (
BGM_PATH). Do not overlay external BGM when the source already has a vocal soundtrack at high volume. When passing--subtitle-y-top/--subtitle-y-bot, by default, a1.0opaque pixel band with mask is enabled only during narration segments (original hard subtitles remain visible during silence segments). If the source has no hard subtitles, or if additionally settingSOURCE_SUBTITLE_MASK_TIMING=all(or simultaneously settingMASK_SOURCE_SUBTITLES=true+SOURCE_SUBTITLE_MASK_TIMING=all+SUBTITLE_MASK_OPACITY=1.0) enables an opaque mask for the entire video while preserving original dialogue, you can write proofread original subtitles inwork_dir/original_subtitles.jsonaccording to the finished video's time (if the original hard subtitles are still visible during silence segments, the compositor will automatically skip overlapping subtitles). - Platform Promo Notes and Canvas Packaging Saved Separately: After the story is finalized, if platform titles, cover frames, and description strategies need to be output, write them to
work_dir/promo_copy.jsonaccording toreferences/promotional-copy.md; write the finished video's canvas visual packaging according toreferences/packaging.mdtowork_dir/packaging_plan.json.
4.4 Voiceover Synthesis and Audio-Video Mixing Rendering
After writing narration.json, re-run the same recap.py command:
- Local Deterministic Validation (
validate.py): Outputsnarration_lint.json. Hard blocks (errors) for time overlap/out-of-bounds, incomplete sentences, interrupting original speech, budget overrun infullmode, and template placeholder leaks. Non-blocking prompts (warnings) for original sound release points without nearby anchors (unsafe_source_release), overly long cold open silence (weak_cold_open_silence), long silent gaps (excessive_dead_air), generic character labels (generic_character_label), and editorial commentary tone (editorial_commentary_tone). - TTS Voiceover (
voiceover.py): Synthesizes speech segment by segment, writing totts_segments/andtts_meta.json. Caching is based on text, voice, model, and reference audio fingerprint. If the measured speech rate is below the lower limit (TTS_MIN_SPEECH_RATE, meaning the synthesized audio is abnormally long), it will automatically retry and save the abnormal audio as*.rejected.wav. - Audio-Video Mixing (
assemble.py): Mixes the visuals, segment-by-segment narration, dynamically ducked original sound with end-of-sentence recovery, optional BGM, optional sound effects (work_dir/sfx_plan.jsonorpackaging_plan.json.sfx), canvas packaging (work_dir/packaging_plan.jsonorpackaging_layers.json, seereferences/packaging.md), and end-credit audio fade-out into the final MP4. Automatically extracts a frame forwork_dir/cover.jpg(ifpromo_copy.jsonspecifies a cover second, that is preferred) and outputstimeline.json(passing--export-jianyingcan export the video, narration, BGM, subtitles, and packaging images as a Jianying draft). If the narration cannot fit into the available time window even within the micro-acceleration limit, it directly reportsno_safe_fitas a block and does not truncate the ending sound. Audio mode and routing rules are inreferences/audio-modes.md.
4.5 Multi-Video Clipping and Resource Library
Multi-video input only supports cut mode. The project-level brief will list the source_id for each source; each clip in clip_plan.json must have a source_id:
python3 scripts/recap.py ep1.mp4 ep2.mp4 --edit-mode cut --target-duration 10m --work-dir work_dir_multi_ep
Use --material-library-dir .video-materials --save-materials and --use-materials to reuse single-source understanding caches across episodes. Under the same library root, you can also register background music, sound effects, voice types, fonts, stickers, and reusable templates (subtitle_style, packaging, production_reference). Query them with scripts/library.py check|list|show and bind via --project recap_project.json. After synthesis, work_dir/resource_lock.json is automatically generated (see references/resource-library.md for details). To measure the vertical mask range for original hard subtitles, review the extracted frame images, or run tools/measure_subtitle.py <video> in the source repository and then pass --subtitle-y-top and --subtitle-y-bot.
4.6 Final Viewing and Delivery Review
Before delivery, you must directly open the final finished video file and complete an audio-visual review:
- Watch at Normal Speed: Watch from beginning to end without speedup; note any visual jumps or pacing issues.
- Check Splicing Points: Spot-check 0.5–1 second around cut points for flash frames, action jump cuts, or half-sentence truncations of original sound.
- Listen to Audio Track Only: Close your eyes and listen once to confirm the voiceover is coherent and natural, the original sound ducking transitions are smooth, and key dialogue is clear.
- Review Opening, Climax, and Ending: Separately re-watch the first 5 seconds, the middle turning point/thematic highlight, and the ending to confirm the entry timing and lingering impact are solid.
- Revision Check and
final_qc.jsonReview: InREVISIONmode, confirm that revision items are implemented and locked items are not reverted. Check thefinal_qc.jsonfor decoding, duration, and specification results. Ifmetadata.warningsis not empty (e.g.,partial_ttsor missinglibasscausingsubtitle_burn_degradedfallback to external.srt), inform the user accordingly.
4.7 Finished Videos Without Narration
# Directly mix and synthesize the current entire input segment; does not implicitly run understanding, ASR, or TTS
python3 scripts/recap.py locked_picture.mp4 --work-dir source_work --audio-mode source-mix
# Generate a clipping plan according to the cut workflow, clip, and then directly synthesize the original sound finished video; does not pause to wait for narration.json
python3 scripts/recap.py ep1.mp4 ep2.mp4 --edit-mode cut --work-dir cut_work --audio-mode source-mix
source-mix also performs original sound loudness normalization, optional BGM mixing, end-credit fade-out, and audio re-encoding. Switching audio modes requires a new working directory. See references/audio-modes.md for details.
5. Self-Check and Read-Only Dashboard
python3 scripts/doctor.py
python3 scripts/dashboard_server.py --root <directory> [--port 0] [--open]
doctor.py checks the local ffmpeg / ffprobe, subtitle filters, and remote service key configurations. dashboard_server.py starts a read-only review station on 127.0.0.1 (responds only to GET and HEAD), browsing the finished video directory, narration timeline, and material library under --root.
6. Outputs and Parameters
Core deliverables:
recap_<video>.mp4: The final narrated or original sound finished video.subtitles.srt/subtitles.ass: Generated subtitle files.work_dir/: Intermediate analysis, creative plans, and validation artifacts. Field contracts are inreferences/data-schema.md.work_dir/recap_story_plan.jsonandvisual_audio_board.json: Story plans and storyboard audio-visual tables written by the Agent.
Command-line parameters follow python3 scripts/recap.py --help and each stage script's --help. --style is passed as free-form text to the script-writing Agent and is not mapped to a fixed enumeration.
7. Capability Boundaries
- Deterministic baseline checks (residual flash frames, dialogue truncation, narration interrupts or releases original sound mid-sentence,
fullmode hard word count limit, excessive tail trimming, mandatory visual evidence loss, placeholder leak, decoding and packaging specifications) operate as hard gates. - Storytelling intent, opening rhythm, silence length, character naming density, and voice-over writing style are not mechanically scored or gated. The Agent autonomously controls these based on visual evidence, original sound timeline, and
references/creative-editing-playbook.md, and confirms through finished video audio-visual review.