Highlight & Keyframe Mining (Highlight-Mining v2)
1. Positioning
A highlight is not just "what the model thinks looks good," but an interpretable, multi-signal conclusion: every highlight entry must answer the question "why these seconds?"
This skill produces highlight_pick[] and keyframe_candidate[], forming the first-priority asset pool for selecting shots in an editing script.
2. Signal Layers (Deterministic, Free, Reproducible)
| Signal | Calculation | Normalization | Description |
|---|---|---|---|
| Speech Emphasis | Word-level volume × pitch change × speech rate change (z-score relative to speaker baseline) | 0–1 | Accentuation, emotional lift, emphatic sentences |
| Audio Energy | Short-time energy envelope (20ms window / 200ms hop) within the shot, peak percentile | 0–1 | Applause, laughter, music climax, impact sounds |
| Motion Intensity | Mean optical flow magnitude (within shot percentile) | 0–1 | Action peaks; high motion is penalized, not rewarded |
| Face & Expression | Face bounding box area ratio + expression intensity classification score | 0–1 | Close-ups with faces are more valuable |
| Visual Saliency | Central region contrast/color saturation relative value + subject proportion | 0–1 | How "eye-catching" the frame is |
| Semantic Value | Multi-modal model score for "information/emotional value" (0–1) | 0–1 | The only signal requiring a model |
| Novelty | Inverse frequency of the same visual feature within the video (higher = more unique) | 0–1 | Prevents the same dish or same action from appearing repeatedly |
Penalty Items (separate column, not mixed into positive score): Shake shake, Blur blur, Occlusion occlusion, Repetition repetition.
3. Scoring Formula (Reproducible)
base = w_speech·speechEmphasis + w_audio·audioEnergy + w_motion·motion
+ w_face·faceExpression + w_salience·visualSalience + w_semantic·semanticValue
+ w_novelty·novelty
score = clamp(base − (0.5·shake + 0.6·blur + 0.4·occlusion + 0.7·repetition), 0, 1)
Scene Weight Profile (weights.profile)
| profile | speech | audio | motion | face | salience | semantic | novelty | Application |
|---|---|---|---|---|---|---|---|---|
knowledge | 0.30 | 0.05 | 0.05 | 0.05 | 0.15 | 0.30 | 0.10 | Knowledge/Science/Education |
travel | 0.10 | 0.15 | 0.15 | 0.10 | 0.25 | 0.10 | 0.15 | Travel/Vlog |
review | 0.25 | 0.10 | 0.10 | 0.15 | 0.15 | 0.20 | 0.05 | Product Review |
drama | 0.20 | 0.15 | 0.15 | 0.30 | 0.10 | 0.05 | 0.05 | Drama/Emotion |
talking | 0.35 | 0.05 | 0.05 | 0.25 | 0.05 | 0.20 | 0.05 | Talking Head/Interview |
The weights are a default aesthetic baseline and can be overridden per project; overrides must be logged (who changed it and why), as they directly affect shot selection results.
4. Three Types of Keyframes (Each Serves Its Own Purpose, No Mixing)
| Type | Definition | Selection Rules | Typical Use |
|---|---|---|---|
Emotion Peak Frame emotion_peak | The frame with the highest emotional/expressive tension | Expression intensity percentile ≥0.9 and sharpness ≥0.6, and not within a blink or mouth transition frame | Cover image, emotional beat, subtitle anchor |
Action Peak Frame action_peak | The frame where the action completes or has maximum motion | Optical flow peak with stable frames ±3 frames; prefer "action landing points" (gesture end/object set down) | Transition, beat sync, freeze frame |
Composition Best Frame composition_best | The most visually pleasing frame | Stability ≥0.8, subject clear, safe margins (title/subtitle area unobstructed), rule of thirds or center composition | Cover background, thumbnail, static display |
Cover Candidate Rules: Prioritize composition_best; if the account is people-focused, prioritize emotion_peak (face area ≥8% and not obstructed); if both are missing, explicitly report "no qualified cover frame" — do not fill in with suboptimal blurry frames.
5. Splice Point Alignment Rules (A Highlight Is Only a Highlight If It Can Be Cut)
- Speech Pause Alignment: Interval endpoints must align with sentence-ending pauses (silence ≥120ms); endpoints falling mid-syllable must be expanded outward to word boundaries.
- Beat Alignment: If the video has a BGM beat grid, endpoints prioritize snapping to the nearest beat (within ±80ms) for beat-sync edits.
- Scene Boundary Alignment: Intervals must fully reside within a single shot; highlights that cross shot boundaries should be split into two entries (for easy selection and transition).
- Safety Margin: Emotion peak frame timecodes must avoid the first and last 0.3s (entry/exit instability), unless the shot duration is <1s.
6. Deduplication & Diversity
- Similarity criteria: Frame histogram distance + semantic tag overlap + temporal proximity (within the same shot <1.5s considered the same candidate).
- For the same "event" (the same action completed once), only keep the candidate with the highest score; merged candidates write an explanation into the
repetitionpenalty. - A set of highlights must cover at least 2
kindtypes (e.g., emotion peak + information node) to avoid the entire video consisting of the same type of footage.
7. Output Contract
Follows schemas/highlight-pick.schema.json and schemas/keyframe-candidate.schema.json:
- Each highlight includes
scoreand per-signal breakdownsignals, penaltiespenalties, weight profile,evidence[],confidence. - Each keyframe includes
kind, frame-leveltimecode,frame,reasons[], technical metrics, andusage[]. - Candidates with a score below 0.45 are not included in the main pool (they may remain in a "backup pool" for use when material is scarce).
Decision Principles (Including Thresholds & Fail-Safe Termination)
- Score must be reproducible: The receipt must provide weights, individual signal values, and penalty items; a recalculation deviation >0.01 means inconsistent metrics — recalculate before outputting.
- Quality threshold before scoring: Candidates with sharpness <0.5 or stability <0.4 are removed from the pool directly (no "high score masking a blurry frame").
- Endpoints must be editable: Highlight endpoints must fall on a sentence-ending pause (≥120ms) or a beat point (±80ms); if not, expand outward to word boundaries; do not cut mid-syllable.
- Fail-safe termination: If no qualified keyframe exists, truthfully report
gaps; do not use suboptimal frames by default (allowFallback=false). - Deduplication over stacking: Peaks within the same shot spaced <1.5s are considered the same event; main pool candidate score floor is 0.45.
Strategy Library (Scene → Action Sequence → Criteria)
- Mainline·Multi-Signal Fusion: Signal normalization → weighted sum → apply penalties → endpoint alignment → deduplication (Criteria: Top-10 human approval rate ≥70%).
- Branch·People-Focused Content: Increase
faceExpressionweight and promoteemotion_peakto primary cover choice (Criteria: Cover usability rate ≥60%). - Branch·Landscape/Empty Shot Focus: Increase
visualSalienceandnovelty; action peak frames become secondary (Criteria: Same-video shot repetition rate ≤15%). - Branch·Long Footage (>30min): First pre-screen candidates by 20s segment quotas, then perform global ranking to prevent "beginning bias" (Criteria: Candidate time distribution covers ≥60% of the entire video).
SOP (Each Step with Trigger/Receipt/Failure Path)
- Trigger (Shot understanding complete) → Read signal table and shot list → Receipt: Candidate pool (with per-signal breakdown); Failure: Missing signal (e.g., no face signal) count as 0 and note in receipt; do not fabricate a score.
- Trigger (Candidate pool ready) → Score and penalty computation → Receipt: Each highlight's
signals/penalties/weights/score; Failure: Unknown weight profile or signal out of range triggers an error, no silent clamping. - Trigger (Scoring complete) → Keyframe selection and deduplication → Receipt: Three keyframe types +
gaps+ merge record; Failure: If quality thresholds are missed, output gap list for human review; do not fill in with suboptimal frames.
Key Metrics (Including Benchmarks & Guardrails)
| Metric | Definition | Benchmark/Threshold | Type | Source |
|---|---|---|---|---|
| Highlight Approval Rate | Human-approved highlights / Top-10 | ≥70% | Quality | Human spot check |
| Keyframe Usability Rate | Usable keyframes / Required count per three types | ≥60% | Quality | Human spot check + technical threshold |
| Endpoint Compliance Rate | Endpoints on pause/beat/scene boundaries / All endpoints | 100% | Guardrail | Alignment validator |
| Duplicate Candidate Rate | Candidates flagged as duplicates / Total candidates | ≤10% | Quality | Dedup receipt |
| Recalculation Consistency Rate | Entries matching recalculated score / Sampled entries | 100% | Guardrail | Recalculation script |
Failure Modes (Symptom → Detector → Action)
| Symptom | Detector | Action |
|---|---|---|
| All highlights are within the first 10 seconds | Candidate time distribution statistics | Apply per-duration segment quotas and increase novelty weight |
| Selected "highlight" is a shaky segment | Sharpness/stability threshold not met | Add shake penalty; remove any candidate with sharpness <0.5 |
| Cover frames are all blurry | composition_best threshold not enforced | Force sharpness ≥0.7, stability ≥0.8; otherwise report a gap |
| Two highlights are actually the same action | Deduplication threshold too loose | Tighten temporal proximity (same shot <1.5s merge) and increase repetition penalty |
| Model scores are all above 0.9 | Scoring not calibrated | Use within-video percentile calibration instead of absolute values, and record calibration method in receipt |
8. Self-Checklist
- Every highlight endpoint is within a shot boundary and close to a speech pause or beat point
- Score is reproducible: using the weights and signal values from the receipt, you can compute the same
score - Penalties and positive scores are listed separately and not "averaged out"
- All three keyframe types have candidates (or explicitly state the reason for no qualified frame)
- No duplicate events; for the same event, only the highest score is kept
- Each entry has an evidence frame and confidence (G-ED4)