Communitygithub.com

chengfeng-videocut-skills

Burns edited talking-head footage into a final MP4 file: integrates timeline clips, zooms, subtitles, and HTML overlay layers in one pass. Use when the user says export, render, burn subtitles, generate final file, or output the finished video. Not for generating word-deletion candidates, writing subtitles, or creating animation effects.

What is chengfeng-videocut-skills?

This skill is the final rendering step in the video production pipeline, converting all project annotations—such as the edit list (which words to speak), subtitles (what text to display on screen), and visuals (overlay layers)—into a single MP4 file. It does not modify the project or any other files; it only reads the existing `edit-list.json`, `subtitles.json`, `visuals.json`, and modules to produce the final output. The export process operates outside the editing state machine, meaning it never alters project state or writes to the CAS. It relies on Google Chrome to rasterize subtitles and animations into images, and FFmpeg (v6+) for media encoding. A two-step workflow is enforced: first a `--dry-run` plan that reports the expected duration, frame count, subtitle screens, visual layers, zoom segments, and output resolution—any discrepancy here must be fixed upstream—followed by the actual render (assemble, overlay, compose, verify). The skill also provides guidance on resolution handling (upscaling subtitles and animations for low-res sources) and source replacement when the user provides a high-definition version of the same recording. Verification requires three checks: command success with readback validation, manual frame inspection (not using preview screenshots), and a human listening test. If problems occur, the `--keep-work` flag preserves intermediate files to isolate which stage failed.

Works with✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Agentchengfeng/chengfeng-videocut-skills/tree/HEAD/plugins/chengfeng-videocut/skills/chengfeng-export

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Export (Final Output)

This is the last segment of the chain, and the only place in the entire product where actual pixels are drawn.

Everything before this is annotation: the ledger records "which words to speak", the subtitles record "what to write on screen", the visuals record "what layers to overlay", and the preview stitches these three together in real-time for the user to see—without writing to disk. Export burns them into a single file.

Input:   edit-list.json (required), subtitles.json, visuals.json + modules/
Output:  final.mp4

Prerequisite tool: Google Chrome on the machine (used to rasterize subtitles and animations as images). FFmpeg / FFprobe installed from the desktop app have already been placed in the Product-managed directory; pure CLI installation still requires system ffmpeg ≥ 6. If Chrome is missing, an explicit error will be reported—do not try to bypass it: without Chrome, there are no subtitle or animation layers.

First read and execute the "Conclusion Level" section of the business skill phase contract. Export does not enter the editing state machine: it does not modify any project files, does not write to CAS, and does not advance the stage; the output is a new file, and re-running overwrites it. Therefore, it does not require a confirmation card.

0. Readiness

First execute Check Updates's "Readiness Check"—whether skills are up-to-date and the Runtime is compatible; the plugin root is also located there (all <plugin root> in this document refer to that literal path). Only proceed if "Ready"; for "New Session Required" or "Stop", follow its disposition (including the "No custom alternative interface" prohibition); the business skill does not include its own environment logic.

If the readiness result is runtime.kind=desktop-managed, directly reuse the stable CLI, media tools, and the same launchd/windows-task service already installed by the desktop App; do not parse Electron paths, install additional FFmpeg/Bun, or start a second Runtime.

Commands

node "<plugin root>/scripts/ensure-running.cjs" --json
node "<plugin root>/scripts/videocut-cli.cjs" export <project> --dry-run --json          # Preview plan, no encoding
node "<plugin root>/scripts/videocut-cli.cjs" export <project> --json                    # Final output (default 2x, source framerate)
node "<plugin root>/scripts/videocut-cli.cjs" export <project> --out /path/final.mp4 --json
node "<plugin root>/scripts/videocut-cli.cjs" export <project> --scale 1 --json          # Source size only
node "<plugin root>/scripts/videocut-cli.cjs" export <project> --keep-work --json        # Keep intermediate files for debugging

If ensure-running reports identity mismatch, port conflict, or unhealthy service, stop immediately; do not temporarily substitute with foreground mode and continue exporting.

Two Steps, Don't Run Only the Second Step

① --dry-run first reports the plan:  duration, frame count, subtitle screens, visual layers, zoom segments, output resolution
                                     Read it to the user. If the numbers are wrong, the upstream is wrong; ten minutes of encoding won't fix it
② Actual run:                        assemble → overlay → compose → verify four-stage progress

Any warnings in --dry-run must be relayed verbatim. They only report one thing: some subtitle screens or visual layer words have already been cut, so they will not appear in the final output. This is an upstream decision, not something export should silently swallow.

Resolution: Source is the Ceiling—Check Source Before Upscaling

Check the source resolution before exporting (the source field in --dry-run already has it):

Source width ≥2560 (Retina native screen recording)  → --scale 1, output is native pixels—this is the best case
Source width <1920 (e.g., 960×720)                    → Pause first: ask the user if there is a high-definition export of the same recording.
                                                      Screen recording tools can often re-export the same recording at 3x resolution;
                                                      replacing the source is far more effective than any post-processing (see next section).
                                                      If truly not available → --scale 2

Why --scale 2 helps with low-res sources: enlarging the original won't make it clearer, but subtitles and animations are redrawn at the output resolution—those are what viewers actually read; and when the platform compresses again, the larger image gets a higher bitrate.

Do not adjust --fps to try to make it "clearer." Frame rate follows the source; changing it will desynchronize animation sampling with the screen recording.

Source Replacement: When the User Provides a High-Def Version of the Same Recording

This is not part of the export flow—export itself is always read-only. Source replacement is an independent material operation after the user explicitly agrees; then return to normal export.

First determine if it's the same take (the first two criteria are sufficient):

ffprobe -v error -show_entries format=duration -of csv=p=0 <two files>   # Duration must match to the millisecond
ffmpeg -v error -i <file> -map 0:a:0 -c copy -f md5 -                   # Audio streams must be bit-identical
# Then sample two or three frames to visually compare content

Bit-identical audio = identical timeline: word scripts, ledgers, subtitles, visual layers are all bound to word IDs—none need to change. This is the payoff of "binding to words, not to seconds" for source replacement.

Source replacement steps (actually performed once on 2026-07-29; step ③ was missed back then, and the clip preview immediately reported "generation failure"—fingerprints are recorded in more than one place; grep the old fingerprint to find all occurrences before proceeding):

① Replace the file    input/source.mp4 and uploads/source.mp4 are a hardlink pair —
                      delete both, copy the new file to input/, then recreate the hardlink to uploads/
                      (macOS: use ln; Windows: use New-Item -ItemType HardLink)
② Update the fingerprint   project.json's source.sha256 to the new file's
③ Check another location   workbench.json's sourceSha256 also records the source file fingerprint;
                           the clip preview pipeline validates against this very one—miss it and preview will refuse to generate
                           (This is the correct behavior of the product: fingerprint mismatch fails safely, not serving an old preview)
④ Re-export        --scale 1 — Source replacement is for native pixels; do not upscale again

Safest approach: use your search tool on all *.json files in for the first 8 characters of the old fingerprint; every occurrence found must be handled (cache files like preview-edited/current.json will auto-recalculate, no manual change needed).

If the audio is different (re-recorded, trimmed, duration changed), it is not source replacement—it's a new project: the word script must be re-transcribed, and all annotations are invalid. Do not force it.

Verification: Three Things—Missing Any Means Export Is Not Complete

① Command succeeded           The product measures the final output's size, frame count, and audio tracks, and compares each against the plan.
                              If they don't match, it reports readback_mismatch, keeps the file on disk as evidence,
                              and does not consider the export complete.
② Extract frames and inspect pixels   Extract frames from the final output and check visually. Must cover at least: one zoom segment,
                                      one full-screen animation segment, one subtitle-only segment, and one layer boundary.
③ Human listening                     No one has ever actually listened; always record as human listening UNVERIFIED

② Must not be replaced by preview screenshots. Preview and final output are two different render paths; the verification aims to see if they match—using preview images as evidence for the final output assumes the very thing being verified.

To determine if zoom is applied, look for discriminative landmarks; overall impression can be deceiving (real experience from 2026-07-29): after a 1.6x zoom, the screen page still looks like "one whole page"—in the thumbnail it's nearly identical to the full view—causing a correct zoom frame to be mistakenly dismissed as "zoom missing", wasting 30 minutes and two re-exports. The correct method is to look for evidence that only cropping can cause: elements that are half-cropped (a bubble cut off in the middle), disappearing edge elements (sidebar, title bar). Compare with the same frame from the source to settle immediately.

Extract frames using ffmpeg:

ffmpeg -v error -ss 8.84 -i final.mp4 -frames:v 1 -y frame.png

Troubleshooting Guide

--keep-work leaves three things under the project's .chengfeng-videocut/export/ directory, each isolating which half of the pipeline went wrong:

assembled.mkv    Raw edit only, no overlays. If wrong → ledger or clip segment error
overlay/*.png    Only overlaid content, transparent background. If wrong → subtitle style or module error
spans/*.mp4      Post-composition segments. If wrong → zoom or alignment error

Reference table:

No subtitles/animations in final output        Are overlay PNGs fully transparent? Did the module fail to acknowledge seek?
Animation stuck on first frame                 Module didn't implement seek, or GSAP timeline wasn't paused
Entire frame white                             Module missing `:root { color-scheme: dark }`
Zoom box misaligned                            Module's viewBox and layer's zoom are not using the same coordinate system
Final output shorter than planned               Some span had insufficient frames; check compose phase errors
Layer boundary shows a flash of original       Overlay snapshot is stale (frame marker validation failed). The product uses
                                                a frame marker bar at the top of the page to prove each snapshot belongs
                                                to which frame; if it recurs, first verify the overlay PNG has the marker bar
                                                and that compose crops it out
Chrome not found                               Install Google Chrome; do not switch to a different render path

What Not To Do

  • Do not say "export succeeded" as "verification passed"—command success only means the product can self-match; it's not frame-level verification
  • Do not use preview screenshots, DOM, or logs as a substitute for extracting frames from the final output
  • Do not mark human listening as PASS without actually listening
  • Do not modify project files (change subtitles, delete layers, alter ledger) just to make export succeed. Export is read-only; it does not write
  • Do not perform upstream tasks in export: if subtitles are missing, go write subtitles; if visuals are missing, go create visuals; don't patch a temporary fix here

Individual skills in this repo

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

Agentchengfeng/chengfeng-videocut-skills

剪辑环境的唯一管理者:就绪检查(skills 是否最新 → Runtime 是否配套)、Skills 更新激活、Runtime 安装与体检。用户说检查更新、安装剪辑环境、装播放器、检查剪辑环境、剪辑环境就绪了吗、配置转录凭证时使用;业务 Skill(剪口播/字幕/画面/导出)第 0 步也引用本 Skill 的就绪检查。不用于剪辑、字幕、画面、导出本身或项目数据迁移。

Agentchengfeng/chengfeng-videocut-skills

剪辑中文口播原素材:逐词转录、词典修字出修字表、五轮扫描找口误与重复、汇总表与重复句子表、打开 Studio 让用户复核、复盘沉淀用户偏好与词典。只产出一份已复核的删词账本,不切媒体、不做字幕、不做分镜动画。用户说剪口播、处理口误、生成口播基础素材、继续剪口播,或确认卡回传 action=return_cut_review 时使用。不要用于执行物理剪切、导出剪后视频、单独安装、单独打开工作台或口播分镜成片。

Agentchengfeng/chengfeng-videocut-skills

整理、脱敏并上报 chengfeng-videocut 的 GitHub Bug。用户说上报 Bug、反馈剪口播问题、提交 GitHub Issue、这个问题告诉开发者,或要求继续提交已预览的 Bug 草稿时使用。不要用于功能建议、普通排错、代码提交或未获用户确认的自动上报。

Agentchengfeng/chengfeng-videocut-skills

给剪好的口播做字幕:直接用已有的逐词稿加账本算出剪后时间(不必导出、不必重新转录)、用词典和作者文稿改写听错的专名、按句子分屏、在 Studio 里逐屏复核。用户说做字幕、加字幕、改字幕、重新分屏、字幕不对时使用。不要用于删词剪辑、物理剪切、分镜动画或成片渲染。

Agentchengfeng/chengfeng-videocut-skills

操作 chengfeng-videocut 剪辑工作台的已有工程,通过 Runtime CLI 查工程与词句位置、添加或替换画面覆盖层、移除画面、删除明确指定的词句或片段、拆分裁剪移动已有片段、调整画布比例并回读核验。用户说插入片段、删掉这句、移除动画、换个画面、调整顺序或管理时间线时使用;先区分画面覆盖与主轨顺延插入,不负责自动判断口误、创作动画、制作字幕、导出或排查安装故障。

Agentchengfeng/chengfeng-videocut-skills

Create Ian Xiaohei-style HTML/SVG motion illustrations for Chinese articles, scripts, storyboard scenes, workflow explanations, concept metaphors, and short video visual aids. Use when the user asks for 小黑 SVG、漫画感 HTML、分层 SVG 动效、把小黑生图做成 HTML/SVG、可编辑矢量动效、口播流程动画、手绘漫画动效、正文配图动画, or wants a Xiaohei illustration style adapted into controllable HTML/SVG/GSAP output instead of raster image generation.

Agentchengfeng/chengfeng-videocut-skills

给剪好的口播配画面:在录屏上盖 HTML 层(圈重点标注 / 小黑整屏动画 / 推近),层绑字幕屏、由播放器逐帧驱动、直接在预览里看。用户说做分镜、配画面、加动画、圈重点、B-roll、做 storyboard 时使用。不要用于删词剪辑、字幕、物理剪切或成片渲染。

Related Skills