zenstory-ai/video-recap-skills / skills/video-recap
video-recap
Verified把一段或多集视频做成带画框字幕的中文解说成片或纯原声高光短片。用户提供 .mp4 / .mov / .mkv / .webm,要求做影视解说、短剧二创、加旁白配音、跨集混剪或导出剪映草稿时使用;串联完成看片识台词、定主线与留原声、按台词停顿切镜头、写词检查、TTS 配音与混音加字幕。触发词:视频解说、影视解说、视频旁白、生成解说、视频 recap、video recap、voiceover、narration、recap。
scripts/jianying/model.py
View on GitHub"""Thin internal model used at the JianYing adapter boundary."""
from dataclasses import dataclass, field
from collections.abc import Callable
from jianying.schema import us
from jianying.tracks import TrackAllocator
ProbeFn = Callable[[str], tuple[int, int, int]]
NewIdFn = Callable[[], str]
@dataclass
class DraftBuildContext:
"""Normalized draft build state and overlap-safe track collection."""
width: int
height: int
fps: float
total_us: int
new_id: NewIdFn
probe: ProbeFn
materials: dict[str, list] = field(
default_factory=lambda: {"audios": [], "texts": [], "videos": []}
)
tracks: list[dict] = field(default_factory=list)
notes: list[str] = field(default_factory=list)
track_allocator: TrackAllocator = field(default_factory=TrackAllocator)
@classmethod
def from_timeline(cls, timeline, new_id, probe):
"""Build from a timeline already validated by jianying.timeline_contract."""
canvas = timeline["canvas"]
return cls(
width=canvas["width"],
height=canvas["height"],
fps=float(canvas["fps"]),
total_us=us(timeline["duration"]),
new_id=new_id,
probe=probe,
)
def add_segment(self, kind, base_name, start_us, duration_us, segment):
allocated = self.track_allocator.allocate(kind, base_name, start_us, duration_us)
track = next(
(
item for item in self.tracks
if item["_semantic_kind"] == allocated.kind
and item["name"] == allocated.name
),
None,
)
if track is None:
track = {
"attribute": 0,
"flag": 0,
"id": self.new_id(),
"is_default_name": True,
"name": allocated.name,
"segments": [],
"type": allocated.track_type,
"_semantic_kind": allocated.kind,
"_layout_order": allocated.layout_order,
}
self.tracks.append(track)
track["segments"].append(segment)
return track
def finalize_tracks(self):
# Python's stable sort preserves the timeline's authored order inside
# one semantic band (for example narration before BGM).
self.tracks.sort(key=lambda item: item["_layout_order"])
type_counts = {}
for track in self.tracks:
count = type_counts.get(track["type"], 0)
track["flag"] = 0 if count == 0 else 2
type_counts[track["type"]] = count + 1
del track["_semantic_kind"]
del track["_layout_order"]
return self.tracks
def note(self, message):
self.notes.append(message)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |