Skip to content

zenstory-ai/video-recap-skills / skills/video-recap

video-recap

Verified

把一段或多集视频做成带画框字幕的中文解说成片或纯原声高光短片。用户提供 .mp4 / .mov / .mkv / .webm,要求做影视解说、短剧二创、加旁白配音、跨集混剪或导出剪映草稿时使用;串联完成看片识台词、定主线与留原声、按台词停顿切镜头、写词检查、TTS 配音与混音加字幕。触发词:视频解说、影视解说、视频旁白、生成解说、视频 recap、video recap、voiceover、narration、recap。

FileKindSize
SKILL.mdskill md18.4 KB
assets/dashboard/app.jsscript16.2 KB
assets/dashboard/index.htmlother867 B
assets/dashboard/styles.cssother22.6 KB
assets/dashboard/tokens.cssother8.9 KB
assets/dashboard/views.jsscript31.4 KB
references/audio-modes.mdmarkdown3.6 KB
references/config-playbook.mdmarkdown8.1 KB
references/creative-editing-playbook.mdmarkdown12.3 KB
references/data-schema.mdmarkdown34.6 KB
references/index-tts.mdmarkdown2.1 KB
references/jianying/LICENSE.duo-videoother1.0 KB
references/jianying/SOURCE.mdmarkdown703 B
references/jianying/empty_draft_meta_info.jsonconfig1.7 KB
references/jianying/empty_jy_material_video.jsonconfig1.8 KB
references/jianying/empty_jy_meta_material_value.jsonconfig358 B
references/jianying/empty_jy_project_info.jsonconfig3.6 KB
references/jianying/empty_jy_segment.jsonconfig1.3 KB
references/jianying/empty_jy_text_styles.jsonconfig440 B
references/jianying/empty_yj_material_audio.jsonconfig865 B
references/jianying/empty_yj_material_text.jsonconfig2.4 KB
references/packaging.mdmarkdown6.8 KB
references/promotional-copy.mdmarkdown4.1 KB
references/prompt-templates.mdmarkdown2.0 KB
references/research-guide.mdmarkdown2.7 KB
references/resource-library.mdmarkdown12.1 KB
references/shot-review.mdmarkdown4.8 KB
scripts/agent_text.pyscript2.7 KB
scripts/artifacts.pyscript972 B
scripts/asr.pyscript12.5 KB
scripts/asr_timing_evidence.pyscript4.2 KB
scripts/assemble.pyscript31.0 KB
scripts/assemble_constants.pyscript894 B
scripts/assembly_contract.pyscript10.3 KB
scripts/assembly_settings.pyscript3.8 KB
scripts/audio_automation.pyscript6.6 KB
scripts/audio_mix.pyscript18.5 KB
scripts/briefing/__init__.pyscript101 B
scripts/briefing/builder.pyscript31.1 KB
scripts/briefing/context.pyscript6.1 KB
scripts/briefing/timeline.pyscript23.0 KB
scripts/codec_peak.pyscript5.1 KB
scripts/cut.pyscript148 B
scripts/cut_cli.pyscript12.4 KB
scripts/cut_contract.pyscript13.3 KB
scripts/cut_qc.pyscript1.9 KB
scripts/cut_render.pyscript13.2 KB
scripts/dashboard/__init__.pyscript159 B
scripts/dashboard/data.pyscript24.6 KB
scripts/dashboard/io.pyscript7.1 KB
scripts/dashboard/runs.pyscript21.8 KB
scripts/dashboard/templates.pyscript9.6 KB
scripts/dashboard_server.pyscript9.3 KB
scripts/detect.pyscript22.2 KB
scripts/doctor.pyexecutablescript12.9 KB
scripts/entry_suggestion.pyscript4.6 KB
scripts/export_jianying.pyscript5.6 KB
scripts/extract.pyscript2.5 KB
scripts/final_qc.pyscript19.0 KB
scripts/frame_grid.pyscript10.6 KB
scripts/jianying/__init__.pyscript49 B
scripts/jianying/builders.pyscript11.3 KB
scripts/jianying/model.pyscript2.7 KB
scripts/jianying/optional.pyscript1012 B
scripts/jianying/schema.pyscript2.5 KB
scripts/jianying/templates.pyscript1.0 KB
scripts/jianying/timeline_contract.pyscript5.8 KB
scripts/jianying/tracks.pyscript2.0 KB
scripts/jianying/writer.pyscript7.8 KB
scripts/lib.pyscript29.6 KB
scripts/library.pyscript31.1 KB
scripts/lint_summary.pyscript5.0 KB
scripts/loudness.pyscript14.7 KB
scripts/materials.pyscript22.1 KB
scripts/media.pyscript18.8 KB
scripts/narration_audio.pyscript13.5 KB
scripts/narration_lint.pyscript24.1 KB
scripts/narrative_selection.pyscript8.9 KB
scripts/packaging.pyscript6.1 KB
scripts/packaging_fonts.pyscript12.0 KB
scripts/packaging_plates.pyscript31.2 KB
scripts/packaging_studio.pyscript34.1 KB
scripts/providers/__init__.pyscript72 B
scripts/providers/fish_audio.pyscript3.1 KB
scripts/providers/index_tts.pyscript8.8 KB
scripts/recap.pyscript183 B
scripts/recap_cli.pyscript6.9 KB
scripts/recap_inspect.pyscript16.5 KB
scripts/recap_runner.pyscript22.0 KB
scripts/recap_runtime.pyscript11.8 KB
scripts/recap_source.pyscript1.8 KB
scripts/recap_stage_qc.pyscript2.7 KB
scripts/recap_timeline.pyscript7.7 KB
scripts/render_preflight.pyscript1.7 KB
scripts/resources/__init__.pyscript200 B
scripts/resources/lock.pyscript6.8 KB
scripts/resources/project_binding.pyscript16.1 KB
scripts/sentence_boundaries.pyscript28.8 KB
scripts/sentence_gate.pyscript8.6 KB
scripts/sfx_mix.pyscript14.6 KB
scripts/shot_review.pyscript18.9 KB
scripts/source_subtitles.pyscript7.2 KB
scripts/speech_ownership.pyscript9.3 KB
scripts/storyboard.pyscript21.8 KB
scripts/subtitles/__init__.pyscript56 B
scripts/subtitles/core.pyscript19.0 KB
scripts/subtitles/render.pyscript8.0 KB
scripts/timeline.pyscript8.2 KB
scripts/timeline_emit.pyscript5.4 KB
scripts/tts_audio.pyscript9.6 KB
scripts/tts_cache.pyscript4.5 KB
scripts/understand.pyscript171 B
scripts/understanding_brief.pyscript6.3 KB
scripts/understanding_cache.pyscript8.0 KB
scripts/understanding_runner.pyscript9.8 KB
scripts/understanding_storyboard.pyscript11.9 KB
scripts/validate.pyscript5.7 KB
scripts/visual_render.pyscript10.1 KB
scripts/vlm.pyscript16.4 KB
scripts/voiceover.pyscript28.0 KB

scripts/resources/lock.py

View on GitHub
"""Record every resource and template a finished run used: ``work_dir/resource_lock.json``.

Facts come from artifacts the stages already wrote (run manifest, ``tts_meta.json``,
``assembly_manifest.json``) plus the optional project binding. When a library is
configured, each file-backed entry is matched to a registered resource by resolved path
so its licence and consent status travel with the run. Nothing here changes a render.
"""
from __future__ import annotations

import json
from datetime import datetime, timezone
from pathlib import Path

import library as library_lib
from lib import file_identity, read_json_object

LOCK_NAME = "resource_lock.json"
LOCK_SCHEMA = "video-recap.resource-lock.v1"


def _file_entry(role: str, path, detail=None) -> dict:
    entry = {"role": role, "path": None, "size": None, "mtime_ns": None,
             "detail": detail or {}, "library": None}
    if path:
        resolved = Path(path).expanduser().resolve()
        entry["path"] = str(resolved)
        if resolved.is_file():
            entry.update(file_identity(resolved))
    return entry


def _source_entries(work_dir: Path) -> list[dict]:
    manifest = read_json_object(work_dir / "recap_run_manifest.json") or {}
    if manifest.get("mode") == "multi_source":
        return [_file_entry("source_video", s.get("source_path"), {"source_id": s.get("source_id")})
                for s in manifest.get("sources", [])]
    if manifest.get("source_video"):
        return [_file_entry("source_video", manifest["source_video"])]
    return []


def _voice_entry(work_dir: Path) -> dict | None:
    meta = read_json_object(work_dir / "tts_meta.json")
    if meta is None:
        return None
    voice = meta.get("voice") or {"provider": meta.get("engine")}
    reference = voice.get("reference") or {}
    entry = _file_entry("voice", reference.get("path"), {
        "provider": voice.get("provider"), "model": voice.get("model"),
        "voice_id": voice.get("voice_id"),
    })
    return entry


def _assembly_entries(work_dir: Path) -> list[dict]:
    manifest = read_json_object(work_dir / "assembly_manifest.json") or {}
    settings = manifest.get("assembly_settings") or {}
    entries = []
    bgm = (settings.get("audio_mix") or {}).get("bgm_path")
    if bgm:
        entries.append(_file_entry("bgm", bgm))
    packaging = (settings.get("video_filters") or {}).get("packaging_layers") or {}
    for layer in packaging.get("layers", []):
        entries.append(_file_entry("packaging_layer", layer.get("path"), {"name": layer.get("name")}))
    style = settings.get("subtitle_style")
    if isinstance(style, dict):
        entries.append(_file_entry("subtitle_font", style.get("font_file"),
                                   {"family": style.get("font_name")}))
    return entries


def _match_library(entries: list[dict], index: dict) -> None:
    by_path = {}
    for resource in index["resources"]:
        for f in resource["files"]:
            by_path[str(Path(f["path"]).resolve())] = resource
    voices = [r for r in index["resources"] if r["kind"] == "voice"]
    records = {r["id"]: json.loads(Path(r["record"]).read_text(encoding="utf-8"))
               for r in index["resources"]}
    for entry in entries:
        resource = by_path.get(entry["path"]) if entry["path"] else None
        if (resource is None and entry["role"] == "voice" and not entry["path"]
                and isinstance(entry["detail"].get("voice_id"), str) and entry["detail"]["voice_id"]):
            detail = entry["detail"]
            resource = next((v for v in voices
                             if (records[v["id"]].get("voice") or {}).get("provider") == detail.get("provider")
                             and (records[v["id"]].get("voice") or {}).get("voice_id") == detail.get("voice_id")), None)
        if resource is None:
            continue
        record = records[resource["id"]]
        entry["library"] = {"id": resource["id"], "kind": resource["kind"],
                            "license": resource["license"],
                            "consent": (record.get("consent") or {}).get("status")}


def _attention(entries: list[dict], library_configured: bool) -> list[dict]:
    items = []
    for entry in entries:
        role, lib = entry["role"], entry["library"]
        if role == "source_video":
            continue
        if lib is None:
            if library_configured and (entry["path"] or role == "voice"):
                items.append({"code": "unregistered", "role": role,
                              "message": "资源库中没有登记这项资源,授权状态未知"})
            continue
        if lib["license"] in {"unknown", "restricted"}:
            items.append({"code": f"license_{lib['license']}", "role": role,
                          "message": f"{lib['id']} 的授权状态为 {lib['license']},交付前需要人工确认"})
        if role == "voice" and entry["path"] and lib.get("consent") != "granted":
            items.append({"code": f"consent_{lib.get('consent') or 'unknown'}", "role": role,
                          "message": f"{lib['id']} 的参考音频声音授权未确认"})
    return items


def build_resource_lock(work_dir, *, library_dir=None, project=None) -> dict:
    """Assemble the lock payload from a finished work_dir; ``project`` is a resolved binding."""
    work_dir = Path(work_dir)
    entries = _source_entries(work_dir)
    voice = _voice_entry(work_dir)
    if voice:
        entries.append(voice)
    entries += _assembly_entries(work_dir)
    library_root = None
    if library_dir and Path(library_dir).is_dir():
        library_root = str(Path(library_dir).resolve())
        index, _ = library_lib.scan_library(library_root)
        _match_library(entries, index)
    return {
        "schema": LOCK_SCHEMA,
        "generated_at": datetime.now(timezone.utc).replace(microsecond=0).isoformat().replace("+00:00", "Z"),
        "work_dir": str(work_dir.resolve()),
        "library": library_root,
        "project": ({"path": project["path"], "name": project.get("name", "")} if project else None),
        "templates": list((project or {}).get("templates", [])),
        "resources": entries,
        "attention": _attention(entries, library_root is not None),
    }


def write_resource_lock(work_dir, *, library_dir=None, project=None) -> dict:
    lock = build_resource_lock(work_dir, library_dir=library_dir, project=project)
    path = Path(work_dir) / LOCK_NAME
    path.write_text(json.dumps(lock, ensure_ascii=False, indent=2), encoding="utf-8")
    return lock


def summary_line(lock: dict) -> str:
    registered = sum(1 for e in lock["resources"] if e["library"])
    text = (f"[video-recap] 资源记录: {LOCK_NAME}({len(lock['resources'])} 项,"
            f"资源库已登记 {registered} 项)")
    if lock["attention"]:
        text += "\n" + "\n".join(f"[video-recap]    ⚠ {a['role']}: {a['message']}" for a in lock["attention"])
    return text
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
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: 196kUpdated Claude CodeCodexVerifiedInstall