Communitygithub.com

lhg-plugs/lhg-motion-video

动效导出与质检方法论:ffmpeg 导出参数、平台规格、成片自查流程。点"导出"之前先用它过一遍。

lhg-motion-video 是什么?

lhg-motion-video is a Claude Code agent skill that 动效导出与质检方法论:ffmpeg 导出参数、平台规格、成片自查流程。点"导出"之前先用它过一遍。.

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

在你喜欢的 AI 中提问

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

文档

lhg-mv-deliver:Export and QC

Goal: Every exported byte must withstand the harshest playback and platform scrutiny. Core Discipline: Run the script (machine) first, then do the review (human); never say "releasable" until blockers are cleared.

1. When to Use

  • Exporting final video: Follow sections 3.1–3.2
  • Adapting for multiple platforms: Check section 3.3 specification table
  • Before release: Run the full self-check in section 5

2. Input / Output

Input: Rendered frame sequence + mixed audio + film.json.

Output: out/final.mp4 + captions.srt (if any) + self-check report.

3. Step-by-Step Methodology

3.1 Export Command (Memorize This Parameter Set)

ffmpeg -framerate 30 -i frames/%04d.png -i audio.wav \
  -c:v libx264 -pix_fmt yuv420p -crf 18 \
  -vf scale=1920:1080 -c:a aac \
  -movflags +faststart -shortest out/final.mp4

Why Each Parameter Matters:

ParameterPurposeWhat Happens If Missing
-pix_fmt yuv420pPixel format compatibilityQuickTime will show color shift/black screen (blocker)
-crf 18Quality (16–23 is reasonable)Too high = blurry, too low = huge file size
-movflags +faststartMoves moov atom to frontWeb playback waits for full download before starting
-c:a aacAudio codecSome players output silence
-shortestMatch audio and video durationExtra black frames at the end
-vf scale=Lock resolutionOutput won't match film.json, causing stretching

3.2 Pre-export Checklist

  • film.json four elements match between render, export (width/height/framerate/duration) in all three places
  • All assets are localized, no external links
  • Audio is mixed, loudness at -14 LUFS
  • Subtitles (srt) have no overlaps or overly long lines, safe area declared
  • probe/ still frames match exported frames (no substitutions)

3.3 Multi-platform Specification Quick Reference

PlatformFrame SizeDuration SuggestionNotes
Bilibili / WeChat Landscape1920x1080≤3 minutesCompletion rate is critical
Douyin / Little Red Book Portrait1080x192015–60 secondsFirst 3 seconds decide success
WeChat Moments / Feed1080x1080≤60 secondsOften played muted, subtitles mandatory

One source, multiple deliveries: Prioritize the landscape master; rearrange shots for portrait version (don't just crop—cropping cuts off subtitles and subjects).

3.4 Cover Frame

  • Specify the cover frame timecode in film.json or brief (usually a climax memory point).
  • Export the cover frame as a single high-resolution image. Use it for platform thumbnails; never use a random frame.

4. Anti-patterns

  • ❌ Typing export parameters from memory—memorize the string in 3.1 or save it as a script
  • ❌ Skipping yuv420p and saying "ship it anyway"—some users get black screens, and the reputation damage is irreversible
  • ❌ Directly cropping the landscape version for portrait—subtitles and subjects get cut off, equivalent to a full redo
  • ❌ Never playing the final video on a phone—you won't know about color shift or stuttering
  • ❌ Faking visual data—placeholder data must be marked; using fake data as real is a red line

5. Self-Check Process (Mandatory Before Release)

Step 1: Run Deterministic Audit Script (Mandatory, Zero LLM Cost)

python3 <plugin-dir>/scripts/audit/motion_audit.py --target <video-directory>
  • 28 rules: manifest 4, rendering 7, subtitles 5, export 6, assets 4, brief 2.
  • If blockers exist, the script exits with non-zero exit code—this is by design, not a bug.
  • --fail-on controls exit code semantics: default is blocker; for stricter checks, set to warning.

Step 2: Severity Classification

SeverityDefinitionAction
blockerVideo will fail: mismatched size/framerate, missing yuv420p, overlapping subtitles, missing assetsMust fix; release prohibited until resolved (pre-commit hook will block)
warningLikely a pitfall: no probe, no beat marks, crf out of range, external linked assetsFix now; if impossible to fix, document reason in report
nitPolish items: missing title, non-standard filename, missing -shortestFix when convenient

Step 3: Human Review (What Scripts Can't Cover)

  • Visual: probe still frames match final video; check 5 frames before and after each transition for flash frames
  • Audio-Visual: transition sound effects land on beat within ±0.1s; music climax aligns with visual climax
  • Honesty: visual data / functionality are real; placeholder data is clearly marked
  • Playback: play once on phone + computer; check for no color shift, no black screen at start, no stuttering
  • Subtitles: no occlusion by platform UI (safe area)

Step 4: Output Report

# Self-Check Report: <Video Name> (Date)
## Conclusion: Publishable / Not Publishable
## blocker (n): n fixed, n remaining
## warning (n): n fixed, n waived (reason)
## nit (n)
## Human Review: x/y passed
## Requires Manual Processing

6. Common Issues

Q: The exported mp4 has color shift on iPhone? A: 99% of the time, it's missing -pix_fmt yuv420p. Re-export with it added; this is a hard requirement for QuickTime.

Q: File too large to upload? A: First, raise crf from 18 to 21 (quality loss is barely visible, file size drops ~40%); if still too large, reduce framerate to 24fps. Don't lower resolution—once blurry, it can't be restored.

Q: Web playback takes a long time to start? A: Missing -movflags +faststart. The moov atom is at the end. Re-export with it added; no need to re-render.

7. Self-Check and Feedback

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

  1. Was the script actually run? → If not, it doesn't count.
  2. Are all blockers cleared or listed under "Requires Manual Processing"?
  3. Was the human review checklist fully checked with evidence (including actual playback verification)?

Standard smoke test: Run the script on the plugin's bundled fixtures/ directory; confirm that bad fixtures hit all blockers and good fixtures have zero blockers (see smoke_test.py in the repository root).

Feedback channel: Submit issues with title [QC] <one-sentence problem> to https://github.com/lhg-plugs/lhg-motion-video/issues, clearly stating "input → actual output → expected output". For false positives/false negatives, please attach minimal reproduction cases.

Created by: Liu Hongguang

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

  • GitHub Homepage: https://github.com/lhg-skills — all skills open source here, welcome to star
  • WeChat Video Account: Search for "刘洪光实名上网"
  • WeChat: lhgsmsw

Individual skills in this repo

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

相关技能