Communitygithub.com

lhg-plugs/lhg-video-edit

EDL 剪辑流水线:剪辑决策树(删什么/留什么)、EDL JSON 规范、切点 30ms 音频淡变、ffmpeg 渲染命令模板、字幕样式与封面规范、自检重渲染。不出 EDL 不许渲染。

lhg-video-edit 是什么?

lhg-video-edit is a Claude Code agent skill that eDL 剪辑流水线:剪辑决策树(删什么/留什么)、EDL JSON 规范、切点 30ms 音频淡变、ffmpeg 渲染命令模板、字幕样式与封面规范、自检重渲染。不出 EDL 不许渲染。.

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/lhg-plugs/lhg-video-edit/tree/HEAD/skills/lhg-ve-edit

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

lhg-ve-edit: EDL Editing Pipeline

Goal: Turn the cleaned transcript into machine-executable, human-reviewable edit decisions (EDL), then render the final video. Core Discipline: Write the EDL first, then render — the EDL is the editor's blueprint; working without it is reckless.

1. When to Use

  • Transcription cleaning is complete (lhg-ve-transcript's cross-reference table is confirmed) → proceed to this skill
  • User asks "which parts should be cut" → use Section 3 decision tree
  • After rendering, you hear pops at cuts or subtitle misalignment → check Sections 4 and 5
  • You don't know how to create a thumbnail → Section 7

2. EDL Specification

The EDL (Edit Decision List) is a JSON file describing which time segments of the source footage to keep, which to cut, and how to join them.

{
  "source": "raw.mp4",
  "source_duration_sec": 300.5,
  "target_sec": 60,
  "segments": [
    {"start": 5.0, "end": 12.0, "action": "keep",
     "text": "大家好我是老王", "fade_ms": 30},
    {"start": 12.0, "end": 14.5, "action": "cut",
     "reason": "口头禅:那个那个"},
    {"start": 14.5, "end": 20.0, "action": "keep",
     "text": "三个让完播率翻倍的技巧", "fade_ms": 30}
  ]
}

Field descriptions:

  • action: keep (keep) / cut (delete) / speed (speed change, requires rate)
  • fade_ms: audio fade duration at cut points, required for keep segments, default 30
  • reason: required for cut segments, write the deletion reason (verbal tic / breath / filler / off-topic / noise)
  • audio: optional, silence indicates the segment is silent (used for detecting residual long silences)

EDL validity (automatically validated by pre-render hook, see hooks section):

  • JSON is valid, segments is non-empty
  • Each segment has start < end and within the source duration
  • Segments do not overlap (end-to-end adjacency is allowed)
  • Keep segments must include fade_ms

3. Edit Decision Tree: What to Cut, What to Keep

Cut (put in cut):

  1. Verbal tics and filler words (see lhg-ve-transcript filler word library) — delete all first-level fillers
  2. Breaths and long pauses — delete hesitation pauses; delete breaths in fast-paced content
  3. Filler: repeated statements (e.g., "this is very important, really important" keep once)
  4. Off-topic: digressions from the main topic (unless they are personality-driven)
  5. Noise: coughs, plosives, sudden environmental noises

Keep (put in keep):

  1. Hook: first 5 seconds — do not touch (unless the hook needs rewriting, which is a script issue — send back to lhg-ve-script)
  2. Golden sentences: the sharpest opinion — leave 0.5 seconds of breathing room before and after
  3. Examples and numbers: concrete examples and specific numbers are memory anchors
  4. Transition words: "but", "the key is", "the most important" — they are rhythm nails

Rhythm Rules:

  • For a 60-second talk, aim for a cut or visual change every 3–5 seconds on average — no changes and viewers will scroll away
  • Speaking pace: 220–260 Chinese characters per minute is comfortable; over 300 sounds like arguing, below 180 puts people to sleep
  • Speed change (speed) only for "unavoidable but too long" segments, max 1.25× — beyond that, audio distortion is noticeable

4. Cut Point Audio Processing

Cut point pops are the most common rookie mistake: two clips directly spliced together, discontinuous waveforms causing a "pop" sound.

  • Each keep segment gets a 30ms fade-in and fade-out (afade) at the start and end — this is the plugin's default
  • For spoken-word content, 30ms is sufficient; for vlogs with background music, you can go up to 100ms
  • Check method: after rendering, listen to the 1-second window around each cut point with headphones — if you hear a "click", increase the fade duration and re-render

5. ffmpeg Render Command Templates

The following commands run in order (<...> are placeholders; replace with actual paths):

# 1) Clip and concatenate according to EDL (example: two keep segments, clip then concat)
ffmpeg -i <raw.mp4> -ss 5.0 -to 12.0 -c:v libx264 -c:a aac seg1.mp4
ffmpeg -i <raw.mp4> -ss 14.5 -to 20.0 -c:v libx264 -c:a aac seg2.mp4
printf "file 'seg1.mp4'\nfile 'seg2.mp4'\n" > list.txt
ffmpeg -f concat -safe 0 -i list.txt -c copy cut.mp4

# 2) Fade at cut points (30ms at start and end of each keep segment; alternatively use acrossfade for crossfading between segments)
ffmpeg -i cut.mp4 -af "afade=t=in:st=0:d=0.03,afade=t=out:st=<段尾-0.03>:d=0.03" faded.mp4

# 3) Burn subtitles (style per Section 6; ASS file is generated by the subtitle style)
ffmpeg -i faded.mp4 -vf "ass=<styled.ass>" subtitled.mp4

# 4) Normalize loudness to -14 LUFS (short-video platform standard, prevents volume fluctuations)
ffmpeg -i subtitled.mp4 -af loudnorm=I=-14:TP=-1.5:LRA=11 -c:v copy final.mp4

Honest time estimate: For a 1080×1920, 60-second video, a typical laptop takes about 1–3 minutes to render; 10+ minutes scale proportionally. Higher re-encode quality increases time. Tell the user "roughly X minutes" before starting, so they don't wait blindly.

6. Subtitle Style Specification

  • Position: bottom, ≥12% of frame height from bottom edge (to avoid being covered by platform UI)
  • Single line ≤18 characters, duration 0.6–8 seconds; bilingual/dialect annotations use a second smaller line
  • Style: white text + black outline (BorderStyle=1, Outline=2), font size 4–5% of frame height
  • Keyword highlighting: hook words and golden sentence words in yellow — but no more than 3 yellow words per screen, otherwise they lose effect
  • Prohibited: fancy fonts (artistic fonts must first ensure readability), subtitles covering faces, subtitles extending beyond the safe area

7. Thumbnail Specification

  • Size: 1080×1920 (vertical), strict 9:16 aspect ratio
  • Title: ≤3 lines, each ≤8 characters, font size must be large enough to be readable at thumbnail scale
  • Person: priority on expressive faces (surprise/laughter/seriousness), face must occupy at least 1/3 of the frame
  • Background: clean, should not compete with the title for attention; light vignetting to highlight text is acceptable
  • File ≤2MB (some platforms have upload limits)

8. Self-Check and Re-Render Workflow

Do not deliver after rendering; go through the following:

  1. Watch the full video (1× speed, do not skip or drag the progress bar)
  2. Listen for cut points: listen to 1 second before and after each edit point, with headphones
  3. Check subtitles: subtitle timing must be in sync with lip movements (error >0.3 seconds → re-adjust)
  4. Check duration: final video duration should deviate from target by ≤10%
  5. Run /video-audit: deterministic script + manual review checklist

Fix order: fix the EDL (source) first, then re-render — do not patch final.mp4 (e.g., editing subtitle file separately without re-burning), patching makes the EDL inconsistent with the final video.

9. Anti-Patterns

  • ❌ Rendering without an EDL — when reworking, you won't remember why a segment was cut
  • ❌ No fades at cut points — "pop" noises are the biggest source of cheapness
  • ❌ Patching final.mp4 — EDL and video become inconsistent, causing endless trouble later
  • ❌ Speed change exceeding 1.25× — audio distortion is noticeable to viewers
  • ❌ Subtitles covering faces or extending beyond the safe area — platform UI will overlay another layer, rendering it invisible
  • ❌ Not estimating rendering time beforehand — users will complain after waiting 20 minutes for nothing

10. Self-Check and Feedback

After each execution of this skill, do a lightweight self-check:

  1. Is the EDL written? Has the user confirmed it? → No confirmation, no rendering
  2. Did the pre-render hook pass? → If blocked, fix the EDL; do not disable the hook
  3. Are the four deliverables ready? (final.mp4 + thumbnail + EDL + cleaning cross-reference table)
  4. Did you watch the full video? → Do not deliver without watching

Standard smoke-test case: run video_audit.py on the plugin's built-in fixtures/ and confirm all broken fixtures' EDL/duration/thumbnail markers are hit (see repository root smoke_test.py).

Feedback channel: Submit an issue with title [QC] <one-sentence problem> at https://github.com/lhg-plugs/lhg-video-edit/issues, and include "input → wrong output → expected output" in the body. If the ffmpeg template fails on a new version, please include the version number.

Published by Liu Hongguang

This skill is produced by the real-person IP "Liu Hongguang" (Hefei, Anhui) and belongs to lhg-skills.

  • GitHub profile: https://github.com/lhg-skills — all skills open source here, stars welcome
  • Video platform: search for "刘洪光实名上网"
  • WeChat: lhgsmsw

Individual skills in this repo

This repo contains 3 individual skills — each has its own dedicated page.

相关技能