Shot Understanding (shot-understanding v2)
1. Positioning & Boundaries
- After what: The
probestage (ffprobe/scene detection/ASR/beat) has already produced deterministic cut points and word-level timestamps. - Before what:
highlight(highlights & keyframes) andedit-script(edit script) depend on the fields produced by this skill. - Only does: Turns each shot into structured text fields (visual content/characters/actions/entities/dialogue/on-screen text/shot size/camera movement/lighting/emotion/usability).
- Does not do: Does not detect cut points (that's the signal layer's job), does not select or order shots (that's the editing direction's job), does not provide aesthetic scores (that's the review chain's job).
- Discipline: This stage invokes the model per shot; it is forbidden to "understand the entire video in one call". The old pipeline's failure mode of dumping all video JSON in one call: field collapse in the middle/late sections of long videos, timecode drift, and shot boundaries not matching the visuals.
2. Input / Output Contract
| Input | Source | Purpose |
|---|---|---|
probe.shotBoundaries[] | signal-analyst | Shot intervals (frame-level in/out) — sole authoritative cut points |
probe.speech.words[] | ASR | Dialogue and cut point verification (prefer pauses at sentence end) |
probe.technical.perShot[] | ffmpeg metrics | Quality fields (sharpness/exposure/stability/noise) |
| Keyframes (3–6 per shot) | Frame extractor | Visual input for multimodal models |
Output: shot_record[], per-field following schemas/footage-analysis.schema.json.
Each shot must include: shotId, index, frame-level inTimecode/outTimecode, durationSeconds, sceneType, content (visual description/dialogue/on-screen text/entities/actions), tech (shot size/camera movement/lighting/stability), evidence[] (≥1 frame), confidence.
3. Execution SOP
- Cut point alignment: Use the signal layer cut points as the skeleton; if the model believes a cut point is problematic, it can only "suggest" (write into
editing.cutInReason/cutOutReasonnotes), it must not modify the timecodes itself. - Frame extraction: Evenly extract 3 frames within the shot + motion peak frame + first and last frames (for long shots, add 1 frame every 2 seconds).
- Per-shot invocation (concurrency ≤4, single shot timeout 90s, enter
skippedShotsafter 1 retry failure, do not silently skip):- Input: shot start/end timecodes, extracted frames, ASR word sequence within the shot, per-shot technical metrics.
- Output: Strict JSON (the prompt below provides a template).
- Consistency check: Speech text is compared to the ASR word for word (allow punctuation differences, prohibit content tampering); technical metrics defer to the signal layer (the model can only add semantic context).
- Persist: Write an
understand.event +shot_recordartifact (with model name and promptVersion).
4. Prompt Body (Directly Feedable, v2)
Usage:
{{ }}denotes injection points; require the model to output only JSON. Invoke per shot, do not pass the entire video.
Main channel description (self-collection by multimodal model): On-screen text (OCR) and voice transcription (ASR) are directly produced by the multimodal model during the understanding stage — The model simultaneously receives "keyframes" and "audio (if the model supports the audio modality)", reads the text and transcribes the speech itself, without calling external OCR/ASR tools. The tool channel (native Vision / native ASR engine) serves only as a fallback when the model lacks the capability, and must mark
channel=fallbackin the receipt. It is not allowed to present fallback results as the model's own conclusions. Outputs from both channels are written into the same set of contract fields (content.onScreenText/content.speechText/probe.speech), with the difference only in the truthful annotation ofcoverage.asr.channel/coverage.ocr.channel.
4.1 Mandatory Tasks for the Model (On-Screen Text + Voice + Ambient Sound)
For each shot, the model must complete these three tasks; failing any one means the shot is considered incomplete:
- Full transcription of on-screen text: Read all visible text frame by frame — signs, door headers, packages, banners, street signs, screen UI, subtitles, watermarks;
If the same text repeats, record it only once, but provide the evidence frame; mark unreadable text as
[模糊], do not imagine it into a coherent phrase. Write intocontent.onScreenText(separate multiple entries with/) and point out inevidence[]which frame it was seen on. - Voice transcription: Write
content.speechTextsentence by sentence (preserve colloquialisms, do not polish, do not complete sentences), and provide sentence-level timestamps inprobe.speech.sentences[]; When the model has an audio modality, transcribe directly (channel=model); only mark the fallback channel truthfully when used. Write[听不清]for unclear parts, do not guess. - Ambient sound description: Write the shot's ambient sounds into
audio.ambience(wind noise + leaves / kitchen spatula / market crowd / traffic / firecrackers / quiet), and annotate its utility for editing (can be left as is / can be used as underscore / needs noise reduction / conflicts with BGM).
These three tasks are the factual source for editing and post-production: on-screen text determines location/shop/product, voice determines script and subtitles, ambient sound determines sound design and underscore.
You are a "Shot Understanding Specialist". Task: Transform a shot (already cut by deterministic tools) into structured fields.
[Footage Context]
- Video domain: {{ content_domain }} (knowledge/travel/review/narrative/teaching/life_record/other)
- Footage source type (video-level): {{ source_kind }} (live_action / AI_generated / screen_record / archive)
- Creator profile: {{ creator_profile }}
- User requirement: {{ user_requirement }}
[Input for This Shot]
- Shot number: {{ shot_index }}
- Timecode (frame-level, authoritative, must not be modified): {{ in_timecode }} - {{ out_timecode }} (duration {{ duration_seconds }}s, framerate {{ fps }})
- Extracted frames: {{ frames }} (in chronological order; includes first frame, last frame, motion peak frame)
- Speech transcription within the shot (word-level, authoritative): {{ asr_words }}
- Technical metrics (authoritative): sharpness {{ sharpness }} / exposure {{ exposure }} / stability {{ stability }} / noise {{ noise }}
[Hard Rules]
1. Only describe content that can be proven from the extracted frames and speech transcription; write null or empty arrays for anything not visible, strictly prohibit fabricating people, locations, brands, or data.
2. Do not infer internal thoughts: do not write "he/she thinks/felt"-type unverifiable content, only describe visible expressions, poses, actions, and environment.
3. Speech text must match ASR word for word (punctuation can be removed), do not polish or complete sentences.
4. Each semantic conclusion must be accompanied by evidence (frame number or second point + reason), confidence is a real number 0–1.
5. Output must be valid JSON, no additional explanation, no content outside of Markdown code blocks.
[Scene Classification (single choice of sceneType, affects post-production strategy)]
- live_stream: Live stream clip (studio UI / interaction / compressed quality / needs noise reduction)
- on_location: Live-action shooting (handheld or gimbal / natural or ambient light / ambient sound)
- studio_talking: Studio stand-up or interview (clean background / clear audio / professional lighting)
- b_roll_insert: B-roll and supporting shots (environmental showcase / detail close-up / no speech)
- archive_footage: Archive footage (not shot during this session / historical clips / online material)
- screen_recording: Screen recording (software operation / PPT / game footage)
[Edit-Friendliness Judgments (written into editing)]
- cutInReason / cutOutReason: Where this shot should be entered and exited (action landing / speech breath / visual hard cut / emotional peak / information node)
- transitionSuggestion: Suggested transition to adjacent shots (hard cut / dissolve / match cut / whip pan / jump cut)
- usage: Main narrative / emotional point / reaction shot / transition bridge / background filler / informational emphasis / cover candidate
[On-Screen Text / Voice / Ambient Sound (directly produced by the model, must not be skipped)]
- On-screen text: Read all visible text frame by frame (signs / door headers / packages / banners / street signs / screen / subtitles / watermarks), record repeats only once, mark unclear text as [模糊];
Write into content.onScreenText, and point out "which frame it was seen on" in evidence.
- Voice: Transcribe content.speechText sentence by sentence (preserve colloquialisms, do not polish, do not complete sentences), mark unclear parts as [听不清];
If you (the model) can directly process audio, use your own transcription; only mark the fallback channel truthfully when used.
- Ambient sound: Write audio.ambience (wind noise / kitchen / market / traffic / music / quiet…) + utility for editing (underscore / fill / needs noise reduction / conflicts with BGM).
[Output JSON Template]
{
"shotId": "{{ shot_id }}",
"index": {{ shot_index }},
"inTimecode": "{{ in_timecode }}",
"outTimecode": "{{ out_timecode }}",
"durationSeconds": {{ duration_seconds }},
"sceneType": "on_location",
"content": {
"visualDesc": "Visual content (characters / actions / key objects / environment / visual focus)",
"speechText": "Corresponding dialogue (null if none)",
"onScreenText": "Text appearing in the frame (signs / packaging / subtitles, null if none)",
"keyEntities": ["people / product / concept / location / data point"],
"actions": [{ "who": "who", "what": "did what", "start": 0.0, "end": 0.0 }],
"setting": "Environment (indoor / outdoor / weather / time of day)"
},
"tech": {
"shotSize": "extreme_wide|wide|medium|close_up|extreme_close_up|unknown",
"cameraMove": "static|pan|tilt|push_in|pull_out|tracking|handheld|aerial|unknown",
"lighting": "Natural light / indoor light / professional lighting / backlight / low light",
"stability": "stable|slight_shake|heavy_motion|unknown",
"composition": { "subjectPosition": "", "headroom": "", "leadRoom": "" }
},
"audio": { "speechClarity": 0.0, "ambience": "", "music": true, "clipping": false },
"emotion": { "dominant": "", "intensity": 0.0, "valence": 0.0 },
"quality": { "score": 0.0, "usable": true },
"editing": { "cutInReason": "", "cutOutReason": "", "transitionSuggestion": "", "usage": [] },
"evidence": [{ "t": 0.0, "frame": 0, "why": "Conclusion basis" }],
"confidence": 0.0
}
5. Self-Check List (Verify Each Item Before Output)
- Timecodes exactly match the input (no ±0.5s "rounding" drift)
-
evidencehas at least 1 item, and each item explains a specific conclusion - Speech text matches ASR word for word; shots without dialogue have
speechTextas null - No people, objects, or locations that are not visible in the extracted frames
- Emotion fields are based only on observable evidence (expressions/poses/environment), no internal thoughts
- Conclusions with
confidence < 0.6are marked for re-review ineditingor notes - JSON is valid (no comments, no trailing commas, no Markdown wrapping)
Decision Principles (Including Thresholds and Fail-Closed)
- Timecodes are authoritative from the signal layer: The model may only "suggest" cut points, it must not rewrite the input timecodes; deviations greater than 1 frame from the signal layer result in rollback and realignment according to the signal layer.
- No evidence, no persistence: Each semantic conclusion must carry an
evidence[]array (≥1 frame); conclusions withconfidence < 0.6must not enter the downstream shot selection pool, they can only go to "pending review". - Speech is authoritative from ASR: If the word-for-word match rate between speech text and the ASR word-level transcription is <98%, the speech text is rejected and must be rewritten; no polishing or sentence completion.
- Fail-closed: Unseen fields are written as
null/empty arrays, do not fill with "speculative" values; better to lack a field than to produce a hallucination. - Per-shot isolation: A single shot that fails is retried ≤2 times, then enters
skippedShots; do not rerun the entire video because of one shot (cost and reproducibility).
Tactics Library (Scenario → Action Sequence → Criterion)
- Main: Per-shot standard analysis: Frame extraction (first/last/motion peak + 3 uniform frames) → Single shot invocation → Consistency check → Persist (criterion: field completeness ≥95%, evidence coverage 100%).
- Branch: Long shot (>8s): Add 1 extra frame every 2 seconds, split into "semantic sub-segments" (describe within the same shotId in sections) (criterion: action/information nodes not missed).
- Branch: Multi-person dialogue: Annotate
actions[].whobased on speaker attribution, align with ASR speaker changes (criterion: speaker attribution accuracy ≥90%). - Branch: Low confidence review: Re-extract frames for shots with
confidence < 0.6and re-run (criterion: confidence difference between two runs ≤0.2, otherwise require human review).
SOP (Each Step with Trigger/Receipt/Failure Path)
- Trigger (probe completed) → Concurrent per-shot analysis (concurrency ≤4) → Receipt:
shot_recordbatch + model name + promptVersion; Failure: Retry single shot on timeout/parsing error once, if still fails log intoskippedShotswith reason, do not silently skip. - Trigger (batch analysis completed) → Consistency check (ASR word-for-word, technical metrics authoritative from signal layer) → Receipt: Review list (conflicts and resolutions); Failure: Rollback conflicting shots and retain the old version (only add, never modify).
- Trigger (review passed) → Persist and write
understand.pentadic event → Receipt: Event ID + artifact sha256; Failure: If database write fails, suspend the entire batch and alert, do not treat "partial persist" as complete.
Key Metrics (Including Baselines and Guardrails)
| Metric | Definition | Baseline/Threshold | Type | Source |
|---|---|---|---|---|
| Field completeness rate | Shots passing required validation / Total shots | ≥95% | Quality | Contract Validator |
| Evidence coverage rate | Conclusions with evidence[] / All conclusions | 100% | Guardrail | Pre-persistence Validation |
| Speech match rate | Shots with word-for-word ASR match / Shots with speech | ≥98% | Quality | Consistency Check |
| Hallucination rate | Conclusions determined by manual random check as "not present in footage" / Sampled conclusions | 0 (rollback on detection) | Guardrail | 10% manual random check |
| Single shot rerun rate | Shots triggering a retry / Total shots | ≤5% | Cost | Batch Receipt |
Failure Modes (Symptom → Detector → Resolution)
| Symptom | Detector | Resolution |
|---|---|---|
| Mid/late shot descriptions become empty/copies | Check if it degraded into a full-video single call | Revert to per-shot invocation; batch with concurrency, independent per-shot retries |
| Timecodes don't match visuals | Check if model self-reported timecodes were used | Timecodes always taken from signal layer input, model output ignores timecode modifications |
| Speech text completely mismatched | Frame extraction and speech misaligned | Use ASR word-level intervals to re-verify shot assignment, realign before re-running |
| Brands/locations not present in footage appear | Model hallucination | Delete the conclusion; strengthen "write null for unseen"; increase extraction density |
| Large differences between two runs of the same shot | Temperature or extraction differences | Fix temperature and extraction strategy; if confidence difference >0.3, suspend for review |
6. Differences from the Old Pipeline (Upgrade Log)
| Dimension | Old Version (2026-02 backup) | v2 |
|---|---|---|
| Invocation granularity | One call understands entire video | Per-shot invocation (long videos no longer collapse) |
| Timecodes | mm:ss second-level | Frame-level HH:MM:SS.mmm + frame number |
| Cut point source | Model "guesses from visuals" | Signal layer authoritative cut points (content-aware detection + speech breath) |
| Evidence | None | Each conclusion carries evidence frame and confidence |
| Speech | Model transcription (error-prone) | ASR word-level timestamps as authoritative; model only adds semantic context |
| Quality | 4–5 subjective scoring | Signal layer quantitative metrics + separate semantic usability judgment |
| Output object | Single large file_id JSON | shot_record[] (incremental, single-shot rerunable, versionable) |