Communitygithub.com

video-craft

A unified entry point for creating and analyzing videos. Create: promotional videos, documentary-style shorts, character portraits, explainer videos, product videos—all drawn frame by frame with Remotion (not PPT, not editing software), including music beat sync, lyrics/subtitle timings, hand-drawn scenes, and quantitative verification. Analyze: deconstruct others' videos—extract frames, OCR subtitles and lyrics timestamps frame by frame, measure BPM/first beat, pull Bilibili comments, and check licenses.

What is video-craft?

Video-craft is a comprehensive AI agent skill for both creating and analyzing videos entirely through code, primarily targeting tools like Claude Code, Cursor, or Codex. For creation, it guides a developer through a precise seven-step workflow: measuring music (BPM, first beat, frames per beat), writing a script, creating a beat sheet with exact frame timings, building a Remotion 4 + React 19 + TypeScript project, implementing scene components, mixing audio (BGM + sound effects + narration), and finally verifying the video against six quantitative metrics (specs, motion density, static windows, subtitle sync, color/style, and layout defects). It enforces nine hard rules, such as 'music first, script second' and 'one motion, one meaning' per shot, and uses a single source of truth (the manifest or beat sheet) for all timing. For video analysis, it provides a five-tool kit: getting basic info via ffprobe, frame extraction at custom FPS, frame-by-frame OCR using vlkit to build subtitle/lyric timelines, beat detection (onset envelope + autocorrelation), and fetching Bilibili comments (with login) and background info. Everything is built on a shared toolchain (ffmpeg + Python + Remotion + vlkit), and it supersedes a previous skill 'code-rendered-video'. It also includes references for scene design, external model calls (Claude/GPT/image gen), verification, sound design, delivery/packaging, a library of reusable examples, and a bug list of 30+ known issues.

Works with✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Elysia-laoda/video-craft/tree/HEAD

Ask in your favorite AI

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

Documentation

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.

Related Skills