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:
| Parameter | Purpose | What Happens If Missing |
|---|---|---|
-pix_fmt yuv420p | Pixel format compatibility | QuickTime will show color shift/black screen (blocker) |
-crf 18 | Quality (16–23 is reasonable) | Too high = blurry, too low = huge file size |
-movflags +faststart | Moves moov atom to front | Web playback waits for full download before starting |
-c:a aac | Audio codec | Some players output silence |
-shortest | Match audio and video duration | Extra black frames at the end |
-vf scale= | Lock resolution | Output 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
| Platform | Frame Size | Duration Suggestion | Notes |
|---|---|---|---|
| Bilibili / WeChat Landscape | 1920x1080 | ≤3 minutes | Completion rate is critical |
| Douyin / Little Red Book Portrait | 1080x1920 | 15–60 seconds | First 3 seconds decide success |
| WeChat Moments / Feed | 1080x1080 | ≤60 seconds | Often 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
yuv420pand 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-oncontrols exit code semantics: default isblocker; for stricter checks, set towarning.
Step 2: Severity Classification
| Severity | Definition | Action |
|---|---|---|
| blocker | Video will fail: mismatched size/framerate, missing yuv420p, overlapping subtitles, missing assets | Must fix; release prohibited until resolved (pre-commit hook will block) |
| warning | Likely a pitfall: no probe, no beat marks, crf out of range, external linked assets | Fix now; if impossible to fix, document reason in report |
| nit | Polish items: missing title, non-standard filename, missing -shortest | Fix 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:
- Was the script actually run? → If not, it doesn't count.
- Are all blockers cleared or listed under "Requires Manual Processing"?
- 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