Communitygithub.com

video-craft

做视频与读视频的统一入口。做:宣传片、纪录片式短片、人物志、解说片、产品片——用 Remotion 逐帧代码绘制(不是 PPT、不是剪辑软件),含音乐踩点、歌词/字幕轴、手绘场景、量化验收。读:拆解别人的视频——抽帧、逐帧 OCR 取字幕与歌词时间轴、测 BPM/首拍、拉 B 站评论、查许可证。Use when making a cinematic short, promo or documentary-style video with code, or when dissecting an existing video (frames, lyrics timing, beats, comments).

video-craft 是什么?

video-craft is a Claude Code agent skill that 做视频与读视频的统一入口。做:宣传片、纪录片式短片、人物志、解说片、产品片——用 Remotion 逐帧代码绘制(不是 PPT、不是剪辑软件),含音乐踩点、歌词/字幕轴、手绘场景、量化验收。读:拆解别人的视频——抽帧、逐帧 OCR 取字幕与歌词时间轴、测 BPM/首拍、拉 B 站评论、查许可证。Use when making a cinematic short, promo or documentary-style video with code, or when dissecting an existing video (frames, lyrics timing, beats, comments).

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Elysia-laoda/video-craft/tree/HEAD

在你喜欢的 AI 中提问

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

文档

Video Craftsmanship Handover Package

One-liner: Making a video = measure music first, write script second, draw scenes third, verify with numbers last; Reading a video = extract frames first, OCR second, align timelines third. Both paths share one toolchain (ffmpeg + Python + Remotion + vlkit).

0 Thirty-Second Route Selection

What you want to doRead firstMain output
Create a video from scratchreferences/01-making-videos.mdScript, beat sheet, Remotion project, final mp4
Deconstruct someone else's video (lyrics, subtitles, rhythm, comments)references/02-reading-videos.mdTimeline JSON, comment report, reference frames
Draw scenes / write Remotion componentsreferences/03-scenes-and-engineering.mdComponents, shots, effects
Call external models (Claude / GPT / image gen)references/04-external-models.mdGenerated code / concept art
Video is almost done, needs verificationreferences/05-verification.mdSix numbers + frame extraction conclusion
Need sound effects / image assets (including licenses)references/08-sound-and-assets.mdSelection, download, license list
Use default BGM / check verified BPMreferences/09-track-parameters.mdReady-to-copy BPM, first beat, frames/beat
Make a long video (>40 shots / >3 minutes)references/10-long-videos-and-multi-shots.mdManifest, shot allocation, empty frame check
Do sound design / mixing / fix clippingreferences/11-sound-design-and-mixing.mdPer-shot sound effects table, limiter
Deliver: transcode, package, anonymizereferences/12-delivery-and-packaging.mdDistribution mp4, source code package
Find reusable premade partsreferences/06-example-index.mdLocations of six projects
Stuck on a problem againreferences/07-bug-list.md30 tested entries

1 Nine Golden Rules (Order Cannot Be Changed)

  1. Choose music first: Measure BPM / first beat / frames per beat, write them as code constants. Changing the track requires re-measuring; for music with dense attack transients, use check_tempo with low-frequency verification (see 01 §1.1), otherwise the end will be off by a few seconds.
  2. Write the script second: First define the time structure (flashback / three-act / chapter), then sentences. The script is the single source of truth.
  3. Write the beat sheet third: Each segment gets 'time / frame / visual / action / note / subtitle'; frame numbers must be calculated, never estimated.
  4. One motion, one meaning: Each shot conveys only one thing; after key information lands, it must hold (brand logo ≥ 1 second).
  5. Things in the frame must move on their own, not rely on an overlaid floating light leak. Using global brightness/light leaks to inflate 'motion density' is cheating—verification will expose it, and the audience will notice.
  6. Render probes first, then full render: Use --frames=A-B for tens of seconds, verify, then render the whole film.
  7. Verification relies only on numbers and frame extraction: Duration/frame count, motion density, audio per window, frame extraction with recognition. Visual models can detect layout defects, do not use them to paraphrase text.
  8. For long videos, write time in one place only: The shot table (manifest) is the single source of truth; subtitles, narration, sound effects all derive from it; changing duration requires a full rebuild from the start, otherwise black frames appear every few shots.
  9. Narrative films arrange shots by story time, don't be led by lyric blocks; default to fixed shots (push-in ≤ 4%); for energy, rely on actions inside the frame, not camera movement.

2 Making Videos: Seven Steps and Outputs

StepActionOutputTool
1Measure musicBPM, first beat, frames per beat, per-2s leveltemplates/verification-scripts/analyze_music.py
2Write scriptStructure + per-segment task + visual motiftemplates/script-template.md
3Write beat sheetA table of time/frame/visual/subtitle/sound effects; for long videos, write as manifest.json (single source of truth)templates/beat-sheet-template.md
4Set up projectRemotion 4 + React 19 + TSSkeleton from references/03-scenes-and-engineering.md
5Draw scenesOne component per segment; data comes from the tableSame as above
6Integrate audioBGM + sound effects (+ narration, if any)ffmpeg / composition script
7VerifySix numbers + frame extractiontemplates/verification-scripts/verify_film.py

Layout Rule: Subtitles/lyrics occupy y 118–260; all scene main text goes at y ≥ 300; place a radial dark background beneath lyrics to ensure readability over any frame.

3 Reading Videos: Five Tools

  1. Basic info: Use ffprobe to get resolution/framerate/duration/audio tracks.
  2. Frame extraction: Use ffmpeg -vf fps=2 to extract frames; first try fps=1/5 for a quick overview to find the structure.
  3. Frame-by-frame OCR: Use vlkit ask to batch read images (only ask 'read out all text character by character'), merge 0.5s-granularity text into a timeline; merge repeated lines by musical phrase.
  4. Music: Onset envelope + autocorrelation to find BPM, sweep phase to find the first beat.
  5. Public opinion/background: Bilibili comments (use bili_full.py with logged-in state for full data), news search, license verification.

4 Environment (Already Installed Locally, Do Not Reinstall)

ItemPath / VersionPurpose
ffmpeg / ffprobePATH, v9Frame extraction, audio mixing, verification
Node / npm24.x / 11.xRemotion
Remotion4.0.484 (within project)Rendering
Chrome headless shellDownloaded automatically on first render, cached inside project at node_modules/.remotion/chrome-headless-shellRendering browser
vlkit (image recognition/OCR/ASR)~/.dsh/tools/vlkit/cli.pyView images, read text, transcribe
Bilibili tools~/.dsh/tools/find-bgm/Fetch video info, comments
Model proxyhttps://la-api.vxvxvx.top/v1Code generation, image gen

5 Six Verification Numbers

ItemCriterionHow to Measure
SpecsFrame count = duration × fps, audio track presentffprobe -count_frames
Motion densityP10 ≥ 0.30, peak ≥ 3, peak ÷ valley ≥ 5verify_film.py (MAD per 1/6s window)
Static windowPercentage of frozen frames; if > 40%, question whySame as above
Subtitle syncSample 3 time points, OCR matches expectationsFrame extraction + vlkit
Color/styleVariables or gradients follow design (e.g., red to blue)Sample pixels
Layout defectNo overlaps / out-of-boundsFrame extraction + visual model (layout only)
Empty frame (mandatory for long videos)Per shot at 15/50/85%: brightness ≥ 9, contrast ≥ 6templates/verification-scripts/blank_shots.py

6 Division of Labor with Existing Skills

  • code-rendered-video: Deprecated to pointer (original content merged into this package); all video creation follows this skill; when rules conflict, this package takes precedence.
  • video-shotcraft: 124 lens composition cards + Ink Press template + workbench (use when you need ready-made lens language).
  • aliyun-vl: Specific commands and pitfalls for image recognition/OCR/ASR.
  • bilibili-comments: Three methods for scraping comments and rate limiting.
  • find-video-bgm: Identify BGM, extract audio.
  • visual-verification-discipline: Discipline for layered verification.

7 Remember in One Sentence

Music determines the skeleton, script determines cause and effect, anything on screen that doesn't actually move doesn't count, verification only trusts numbers and frame extraction.

相关技能