Communitygithub.com

ink_history_video

當使用者要求「製作水墨動畫」、「水墨短片」、「水墨歷史短片」、「製作歷史短片」時觸發。此 Skill 指引 AI 以「宣紙底色+墨色濃淡+少量朱紅」的水墨風格,一條龍完成歷史/文化主題短片:代寫旁白稿與分鏡(先確認)→ Gemini TTS 逐句配音 → 去爆音與壓短停頓 → 依實際長度排時間軸與字幕 → 五聲音階程式配樂與自動壓低 → Python 程式逐格繪製水墨畫面 → 自動檢查 → 初版快速壓縮 → 確定版兩階段壓縮成 1080p MP4(大小上限內)。限定水墨風。

ink_history_video 是什么?

ink_history_video is a Claude Code agent skill that 當使用者要求「製作水墨動畫」、「水墨短片」、「水墨歷史短片」、「製作歷史短片」時觸發。此 Skill 指引 AI 以「宣紙底色+墨色濃淡+少量朱紅」的水墨風格,一條龍完成歷史/文化主題短片:代寫旁白稿與分鏡(先確認)→ Gemini TTS 逐句配音 → 去爆音與壓短停頓 → 依實際長度排時間軸與字幕 → 五聲音階程式配樂與自動壓低 → Python 程式逐格繪製水墨畫面 → 自動檢查 → 初版快速壓縮 → 確定版兩階段壓縮成 1080p MP4(大小上限內)。限定水墨風。.

兼容平台✓Claude Code✓Codex CLI~Cursor✓Gemini CLI
npx skills add https://github.com/charyvalis/cuidu-video-skills/tree/HEAD/ink-history-video

在你喜欢的 AI 中提问

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

文档

Ink History Video (ink_history_video) v2

Generates the entire video programmatically, without using video editing software. Example from "The Legend of Baishatun Mazu's Pink Superfast" (2026-10).

Differences Between v2 and v1

  • Engine and Scenes Separated: engine.py remains unchanged; to change the topic, only write script.json + scenes.py.
  • Initial Version Without Writing Code: Scenes without custom scene code use generic scenes (preset: landscape/river/sea/village/night, intro and outro auto-generated), allowing users to review the pacing first, then replace key scenes with custom ones.
  • check Command: Runs all automatable rules from lessons.md (missing characters, vertical text symbols, subtitle length, missing images, narration clipping, mixed models, output specs) in one pass.
  • Cross-platform: Automatically finds a Kai style font (BiauKai → TW-Kai → LXGW WenKai → AR PL UKai); works on Windows, macOS, and Linux.
  • Fixes: Loudnorm is now applied to the final version as well (v1 only applied it to the draft); if the file exceeds the size limit, bitrate is automatically lowered and re-encoded; old segments are automatically cleaned up if the process is interrupted; missing images are replaced with light ink silhouettes without crashing; outro, seal text, and music mood are now configured in script.json instead of being hardcoded as s9 or "Mazu".
  • Works Without API Keys: tts.py --edge (free Taiwanese accent), --voxcpm (cloned teacher voice), --placeholder (espeak placeholder, for testing only).

Files

FilePurpose
scripts/engine.pyEngine: drawing components, scene base, generic scenes, title calligraphy, transitions, narration processing, background music, checking, output
scripts/build.pyCommand entry point: check / audio / stills / cover / draft / video / encode
scripts/tts.pyLine-by-line Gemini TTS; automatically switches model when quota is exhausted, logs in tts/models.json; --list, --placeholder
scripts/scenes_example.pyBaishatun example custom scenes (copy to scenes.py and modify)
scripts/requirements.txtnumpy pillow scipy fonttools google-genai
references/script_example.jsonNarration script and storyboard format example (Baishatun, paired with scenes_example.py)
references/script_preset_example.jsonExample using only generic scenes (Red Cliff Night Cruise, no scenes.py needed)
references/lessons.mdRendering architecture and check rules (must read before starting)

script.json Fields

FieldDescription
title / subtitleFilm title, subtitle (intro)
seal_textSeal text (2 or 4 characters), shared between intro, title calligraphy, and outro
ending_linesVertical text columns for outro (right to left); only needed when using the generic outro
style / voice / tts_modelsTTS tone description, voice (default Charon), model priority order
output_dir / output_name / max_mbOutput path (relative to project folder), filename, size limit (default 20)
fontSpecify font path (optional, auto-detected)
scenes[].id / tag / seal / linesScene ID, vertical calligraphy in top right, whether to stamp under the calligraphy, narration sentences
scenes[].moodCalm / Sad / Heavy / Marching / Climax / Solemn / Joyful / Outro, or a custom dict
scenes[].presetUsed when no custom scene exists: landscape / river / sea / village / night; can add sun, boat, storm

The last scene is automatically used as the outro (7.5 seconds duration).

Standard Workflow (Two 🛑 Stops – Must Wait for User)

1. Intake

Confirm: topic, whether to draft the narration script, voice (default Gemini TTS / Charon + tone description), visual focus, output location and size limit (default 20MB).

  • API keys are only obtained in the conversation; passed via the environment variable GEMINI_API_KEY when executing, never written into any file.
  • Create project folder project/, install packages pip install -r scripts/requirements.txt. All commands are executed inside project/; scripts can be used without copying:
    cd project && python <skill>/scripts/build.py check
    
    (On Windows, prepend set PYTHONIOENCODING=utf-8.)

2. Narration Script & Storyboard → 🛑 STOP 1

  • First verify historical facts; for contested dates or numbers, annotate with "common account" and remind the user during confirmation.
  • Output: film title, scene descriptions, vertical calligraphy in top right, whether to stamp, music mood, and full narration script.
  • Present the storyboard in a table; wait for user confirmation before starting production. If the user changes the title, check whether the narration needs a corresponding line.
  • After confirmation, write to project/script.json, immediately run build.py check (this catches missing characters, vertical text symbols, and overly long subtitles at this step).

3. Line-by-line Narration Recording

GEMINI_API_KEY='<key>' python tts.py          # Run in background; takes about 1 minute per line
python tts.py --list                           # First see which TTS models this key can use
python tts.py s3_1                             # Rerun only a single line
  • Place the user-specified model as the first priority in tts_models. Free quota is about 10 uses per model per day; auto-switch to the next model on HTTP 429.
  • After completion, report which lines used which model from tts/models.json (voice timbre may be inconsistent).
  • If no API key is available yet, use python tts.py --placeholder to build the timeline and frames; later, running tts.py will automatically overwrite the placeholders.
  • Alternatives if the user has no API key (note which one was used in delivery):
    • python tts.py --edge: Microsoft Edge free Taiwanese accent voice (edge_voice default zh-TW-YunJheNeural, male), no API key required, but tone cannot be specified; requires internet access (some cloud environments may block it).
    • python tts.py --voxcpm: Teacher's own cloned voice (VoxCPM2, reference file voxcpm_ref), runs on a machine with voxcpm installed.
    • Apply for a Gemini API key: Google AI Studio → Get API key → Create API key, free.

4. Narration Processing, Timeline, Music

python build.py audio
  • Remove head/tail pop noise, shorten overly long pauses, normalize volume and apply soft limiting; each scene's duration is set based on actual audio length; subtitles are split at pauses.
  • Music is synthesized per scene's mood, automatically lowered when narration is present; after mixing, apply two-stage loudnorm (-16 LUFS).

5. Visual Design & Frame Capture Checks

  • First run with generic scenes: python build.py stills, review pacing yourself (or let the user see).
  • Then write custom scenes for key moments in scenes.py (reference scenes_example.py; from engine import * gives access to all components); any scene not listed in SCENES continues to use the generic scene.
  • If detailed images (people, statues, etc.) are needed, use the openai_image_gen skill to generate "ink-wash style, transparent background, only vermillion accents" images, place them in project/assets/, and composite them with load_img() / put_img().
  • python build.py stills [scene_id...] captures frames (auto-skips transitions); self-check against lessons.md, then run check.

6. Draft Output (Single-Pass Fast Compression)

python build.py draft && python build.py check
  • Parallel rendering based on CPU core count, veryfast + CRF single-pass compression. Any subsequent re-renders during revision also use draft mode.
  • When delivering, explain: specs, duration, file size, check results, and that AI cannot hear the audio — the user must do a listening test.

7. Revisions

Revise based on user feedback, use python build.py stills <scene_id> for localized checks. When the user wants to confirm the cover frame, run python build.py cover (default: take the frame after the intro seal is stamped, before the first transition).

8. Final Version → 🛑 STOP 2

Only execute after the user explicitly says "final version / final draft":

python build.py video && python build.py check
  • Two-stage compression: bitrate calculated based on duration; if size limit is exceeded, re-encode once with reduced bitrate. Use encode to only re-encode without re-rendering.
  • Verification: check lists ffprobe specs and file size; also spot-check frames visually.

9. Post-Production (Only If the User Requests)

  • Facebook post: apply yijun_post_style, optionally include "This video was made by Claude".
  • YouTube upload: browser upload tools have a 10MB limit; the video must be dragged by the user into YouTube Studio; AI fills in other fields (title, description with chapter timestamps, thumbnail, tags, schedule); screenshot for user confirmation before publishing. "AI use" disclosure field is left to the user.
  • Tutorial web page: apply ijun_tool_intro_deploy, placed under /media/<slug>/.

Inviolable Rules

  • Use only ink shades and a small amount of vermillion (fire, sun, plum blossoms, seals, incense embers).
  • Do not write API keys into files; do not fabricate quotes or historical facts the user did not mention.
  • Placeholder audio is for internal testing only — cannot be delivered as final product.
  • Do not use two-stage compression for the draft version; only control file size in the final version.

Individual skills in this repo

This repo contains 1 individual skill — each has its own dedicated page.

相关技能