Loading...
Loading...
Use when the user has one or more video clips and wants to add post-production on top — AI-generated cover as first frame, HTML/CSS captions synced to SRT, kinetic illustration overlays at hook moments, chapter chips, end-card CTA, or any other timed motion graphics. Most often used as the downstream of `/wjs-segmenting-video` — pick up where that skill stopped (raw cropped clip + per-clip SRT) and produce the upload-ready MP4. Backed by HyperFrames so everything compiles to ONE final encode — no cascade of re-encodes. Triggers — "加封面", "加字幕", "加动画", "加 CTA", "做后期", "post-production", "title card", "kinetic captions", "end card".
npx skill4agent add jianshuo/claude-skills wjs-overlaying-video/wjs-segmenting-video/wjs-segmenting-video/wjs-transcribing-audio/wjs-translating-subtitleshyperframes| Is | Is not |
|---|---|
| Everything that goes ON TOP of a video clip: cover, caption, chapter, illustration, CTA | Cutting / cropping a video (that's |
| One HyperFrames composition per clip = ONE final encode | A multi-step decode/encode cascade |
| A separate thumbnail file the user uploads alongside |
Captions are HTML/CSS — | libass burn-in (deprecated) |
Illustrations: re-usable | One bespoke HTML/CSS per illustration without re-use |
| AI covers regenerated at native target aspect (1024×1792 for vertical, 1536×1024 for horizontal) | Single 1024×1536 default that letterboxes or crops on the platform |
clip.mp4 + clip.zh-CN.burn.srt (from /wjs-segmenting-video hand-off)
↓
1. (Optional) Generate AI cover via gpt-image-2
make_cover.py --segments S.json --out output/ --size 1024x1792
cover_NN_slug.png
2. Scaffold a HyperFrames project per clip
hf_clip_NN/1080/{index.html, clip.mp4, cover.png, captions.json}
3. Compose: cover scene + body video + caption track + chapter chip
+ 1-2 illustrations at hook moments + CTA scene
4. npm run check (lint + validate + visual inspect)
npm run render → upload-ready MP4coverffmpeg -ss 0 -vframes 1<div id="cover" class="clip" data-start="0" data-duration="1.6"
data-track-index="1" data-layout-allow-overflow>
<img src="cover.png" alt="" data-layout-allow-overflow />
</div>#cover { position: absolute; inset: 0; background: #0c0d10; overflow: hidden; }
#cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }/wjs-segmenting-video/scripts/make_cover.pygpt-image-2 images edit# For 1080×1920 vertical output (视频号 / 抖音):
make_cover.py --segments S.json --out output/ --size 1024x1792 [--single N]
# For 1920×1080 horizontal output (YouTube / B站):
make_cover.py --segments S.json --out output/ --size 1536x1024--size 1024x15361024x1792--single Ngpt-image-2-skill~/.codex/auth.jsongpt-image-2-skillcaption<div id="caption" class="clip" data-start="{body_start}"
data-duration="{body_dur}" data-track-index="4"></div>#caption {
position: absolute; left: 0; right: 0; bottom: 240px;
height: 240px; z-index: 10; overflow: visible;
}
#caption .bubble {
position: absolute; top: 50%; left: 50%;
display: inline-block;
padding: 0 24px;
font-size: 56px; line-height: 1.18; font-weight: 900;
color: #ffffff; max-width: 1020px; text-align: center;
-webkit-text-stroke: 5px #000;
paint-order: stroke fill;
text-shadow: 0 6px 12px rgba(0,0,0,0.55), 0 0 4px rgba(0,0,0,0.6);
letter-spacing: 0.01em;
}// SRT cues are loaded as inline JSON. Each cue's start/end is offset
// by the cover-scene duration (e.g., 1.5s) so the timing aligns with
// the composition timeline (not the body's own t=0).
const captionEl = document.getElementById("caption");
const groups = JSON.parse(document.getElementById("captions-data").textContent);
const bubbles = groups.map((g, i) => {
const b = document.createElement("span");
b.className = "bubble"; b.id = "cap-" + i;
b.textContent = g.text; b.style.opacity = "0";
captionEl.appendChild(b);
return b;
});
// GSAP xPercent/yPercent for centering (CSS transform would get
// overwritten the moment we tween y).
gsap.set(bubbles, { xPercent: -50, yPercent: -50 });
groups.forEach((g, i) => {
const el = bubbles[i];
tl.fromTo(el, { opacity: 0, y: 12 }, { opacity: 1, y: 0, duration: 0.18, ease: "power2.out" }, g.start);
const exitStart = Math.max(g.start + 0.18, g.end - 0.12);
tl.to(el, { opacity: 0, duration: 0.12, ease: "power2.in" }, exitStart);
tl.set(el, { opacity: 0 }, g.end);
});clip_NN.zh-CN.burn.srtstartend<script id="captions-data" type="application/json">bottom: 240pxbottom: 100pxfont-size: 48px-webkit-text-stroke: 4px/wjs-translating-subtitlesfont-sizechapter<div id="chapter" class="clip" data-start="{body_start}"
data-duration="{body_dur}" data-track-index="3">
<span class="dot"></span>
<span class="text">第一段 · 自然语言才是新代码</span>
</div>#chapter {
position: absolute; top: 80px; left: 60px; z-index: 9;
display: inline-flex; align-items: center; gap: 12px;
padding: 12px 20px;
background: rgba(12,13,16,0.78);
border: 1px solid rgba(199,150,85,0.4);
border-radius: 999px;
}
#chapter .dot { width: 10px; height: 10px; border-radius: 999px; background: #e8b063; }
#chapter .text {
font-size: 24px; color: #f4f4f5; letter-spacing: 0.04em; font-weight: 600;
}tl.from("#chapter", { x: -40, opacity: 0, duration: 0.5, ease: "expo.out" }, body_start + 0.4);
tl.to("#chapter", { opacity: 0, duration: 0.4, ease: "power2.in" }, body_start + 4.0);stack<div id="ill-stack" class="clip" data-start="{start}" data-duration="{dur}" data-track-index="5">
<div class="ill-card">
<div class="ill-card-label">我们写的层级</div>
<div class="ill-row"><span class="ill-tag accent">自然语言</span></div>
<div class="ill-row"><span class="ill-tag">Python</span></div>
<div class="ill-row"><span class="ill-tag">C</span></div>
<div class="ill-row"><span class="ill-tag">Assembly</span></div>
</div>
</div>references/illustration_patterns.mdtl.fromTo("#ill-stack", { x: 360, opacity: 0 }, { x: 0, opacity: 1, duration: 0.6, ease: "expo.out" }, start + 0.2);
tl.from("#ill-stack .ill-row", { y: 20, opacity: 0, duration: 0.4, stagger: 0.12, ease: "power2.out" }, start + 0.4);
tl.to("#ill-stack", { x: 360, opacity: 0, duration: 0.5, ease: "power2.in" }, end - 0.5);hammer<div id="ill-hammer" class="clip" data-start="{start}" data-duration="{dur}" data-track-index="6">
<div class="ill-h-content">
<div class="ill-h-eq">
<span class="ill-h-left">LLM</span>
<span class="ill-h-equals">=</span>
<span class="ill-h-right">新编译器</span>
</div>
<div class="ill-h-foot">自然语言 → Python → 汇编</div>
</div>
</div>tl.fromTo("#ill-hammer", { scale: 0.85, opacity: 0 },
{ scale: 1.0, opacity: 1, duration: 0.45, ease: "back.out(1.6)" }, start);
tl.from("#ill-hammer .ill-h-left", { x: -40, opacity: 0, duration: 0.4, ease: "expo.out" }, start + 0.2);
tl.from("#ill-hammer .ill-h-equals", { scale: 0, opacity: 0, duration: 0.4, ease: "back.out(2)" }, start + 0.4);
tl.from("#ill-hammer .ill-h-right", { x: 40, opacity: 0, duration: 0.4, ease: "expo.out" }, start + 0.6);
tl.from("#ill-hammer .ill-h-foot", { y: 20, opacity: 0, duration: 0.4, ease: "power2.out" }, start + 0.8);
tl.to("#ill-hammer", { scale: 1.05, opacity: 0, duration: 0.45, ease: "power2.in" }, end - 0.45);references/illustration_patterns.mdcta<div id="cta" class="clip" data-start="{cta_start}" data-duration="3.24" data-track-index="1">
<div class="cta-line-1">关注王建硕</div>
<div class="arrow">↓</div>
<div class="cta-line-2">微信公众号 · 视频号</div>
<div class="cta-foot">AI 炼金术 · 持续更新</div>
</div>references/illustration_patterns.mdspec.json + scaffold.pyquotesloganquoteposition: bottomcalloutcustomoverlays/<name>.htmlreferences/custom_overlay_recipes.md/wjs-segmenting-videocover + caption + chapter + illustrations + CTA# For vertical 9:16 output (视频号 / 抖音):
python3 ~/.claude/skills/wjs-segmenting-video/scripts/make_cover.py \
--segments segments.json --out output/ --size 1024x1792 --single 1
# Verify segment 1's cover; then batch:
python3 ~/.claude/skills/wjs-segmenting-video/scripts/make_cover.py \
--segments segments.json --out output/ --size 1024x1792hf_clip_NN/1080/index.htmlreferences/post_segmentation_template.htmlclip.mp4output/clip_NN_slug.mp4cover.pngoutput/cover_NN_slug.pngcaptions.jsonoutput/clip_NN_slug.zh-CN.burn.srtreferences/build_hf_clips.pysegments.jsonILLUSTRATIONSstackhammerILLUSTRATIONS = {
1: [
# The language hierarchy as a stack card during the opening
{"key": "stack", "pattern": "stack", "body_start": 0.3, "body_end": 9.0,
"label": "我们写的层级",
"rows": [
{"text": "自然语言", "accent": True},
{"text": "Python", "accent": False},
{"text": "C", "accent": False},
{"text": "Assembly", "accent": False},
]},
# The hammer at the most quotable moment
{"key": "hammer", "pattern": "hammer", "body_start": 10.8, "body_end": 14.6,
"left": "LLM", "equals": "=", "right": "新编译器",
"foot": "自然语言 → Python → 汇编"},
],
# ... clips 2-5
}python3 references/build_hf_clips.py # scaffolds all projects
for n in 01 02 03 04 05; do
cd "hf_clip_$n/1080"
npx hyperframes lint
npx hyperframes validate
npx hyperframes render
cd ../..
donehf_clip_NN/1080/renders/*.mp4{
"source_video": "../path/to/source.mp4",
"duration": 135.4,
"size": "1920x1080",
"name": "clip_01_animated",
"overlays": [
{"id": "o1", "type": "quote", "start": 8.0, "duration": 6.0,
"position": "top", "lines": ["代码不存在错误", "只存在意图错配"],
"accent": [false, true]},
{"id": "o2", "type": "callout", "start": 30.0, "duration": 5.0,
"anchor": "top-right", "text": "FRP 概念"},
{"id": "o3", "type": "slogan", "start": 122.0, "duration": 13.4,
"lines": ["改 prompt", "不改 AI 生成的代码"], "accent": [false, true]}
]
}| Field | Required | Notes |
|---|---|---|
| Yes | Path to source MP4. Symlinked into the project as |
| Yes | Total composition length in seconds — match the source video. |
| No | |
| Yes | |
| Yes | Start time in seconds. |
| Yes | How long the overlay is on screen. |
python3 ~/.claude/skills/wjs-overlaying-video/scripts/scaffold.py spec.json
cd <name> && npm run check && npm run renderffmpeg -ss 0 -vframes 1 out.mp4关注王建硕npx hyperframes lint && npx hyperframes validatenpx hyperframes inspect1024x1536--size 1024x1792transform: translate(-50%, -50%)ygsap.set(el, { xPercent: -50, yPercent: -50 })/wjs-segmenting-videoffmpeg -ss 0 -vframes 1王建硕object-fit: contain/wjs-segmenting-videoclip_NN.mp4clip_NN.zh-CN.burn.srtsegments.json/wjs-transcribing-audio/wjs-translating-subtitleshyperframeshyperframescustomhyperframes-cliinitlintvalidateinspectrendergpt-image-2-skillmake_cover.py~/.codex/auth.json/wjs-uploading-videoscripts/scaffold.pyreferences/post_segmentation_template.htmlcover + caption + chapter + illustration + CTAreferences/build_hf_clips.pysegments.jsonreferences/illustration_patterns.mdstackhammerreferences/custom_overlay_recipes.mdcustomreferences/example_spec.json