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/dashboard/templates.py

View on GitHub
"""Template parameters as labelled rows plus a schematic preview, for the read-only dashboard.

``param_rows`` turns a template's ``params`` into ``{key, label, value, unit, provenance}``
rows the UI shows as a table; anything it does not know stays in the raw JSON only.
``template_preview`` returns the geometry for a scaled mini canvas: the subtitle band with
one line of exactly ``max_chars`` characters (the "calibrate with the longest line" check),
or the packaging layers at their rects plus the safe area. It is a schematic, not a render.
"""
from __future__ import annotations

import re
from pathlib import Path

from dashboard.io import media_entry

PROVENANCE_LABELS = {"measured": "实测", "fitted": "调出", "specified": "指定", "unknown": "未知"}
SIDE_MARGIN_PX = 40  # assemble.py's default left/right subtitle margin; library.py checks against it
SAMPLE_TEXT = "这是按每行字数校准的最长一行字幕示意"
SUBTITLE_ROWS = (
    ("font", "字体", ""),
    ("size_px", "字号", "px"),
    ("max_chars", "每行字数", "字"),
    ("outline_px", "描边", "px"),
    ("shadow_px", "阴影", "px"),
    ("primary_color", "主色", ""),
    ("outline_color", "描边色", ""),
    ("max_lines", "最多行数", "行"),
    ("band", "字幕带", "px"),
)
ASS_COLOR_RE = re.compile(r"^&H([0-9A-Fa-f]{2})?([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})&?$")
HEX_COLOR_RE = re.compile(r"^#([0-9A-Fa-f]{6})(?:[0-9A-Fa-f]{2})?$")


def ass_to_hex(value) -> str | None:
    """``#RRGGBB`` for an ASS ``&HAABBGGRR`` / ``&HBBGGRR`` or ``#RRGGBB[AA]`` colour, else None."""
    raw = str(value or "").strip()
    hex_match = HEX_COLOR_RE.match(raw)
    if hex_match:
        return f"#{hex_match.group(1).upper()}"
    match = ASS_COLOR_RE.match(raw)
    if not match:
        return None
    _, blue, green, red = match.groups()
    return f"#{red}{green}{blue}".upper()


def _number(params: dict, key: str):
    node = params.get(key)
    value = node.get("value") if isinstance(node, dict) else None
    return value if isinstance(value, (int, float)) and not isinstance(value, bool) else None


def _band(params: dict):
    node = params.get("band")
    value = node.get("value") if isinstance(node, dict) else None
    if isinstance(value, dict) and all(isinstance(value.get(k), (int, float)) for k in ("y_top", "y_bot")):
        return value
    return None


def _rect_text(rect) -> str:
    if not isinstance(rect, dict):
        return "—"
    return f"x {rect.get('x')} · y {rect.get('y')} · {rect.get('width')}×{rect.get('height')}"


def _row(key, label, value, unit, node, swatch=None) -> dict:
    provenance = node.get("provenance") if isinstance(node, dict) else None
    return {"key": key, "label": label, "value": value, "unit": unit, "swatch": swatch,
            "provenance": provenance, "provenance_label": PROVENANCE_LABELS.get(provenance, "")}


def param_rows(kind: str, params, resources: dict) -> list:
    """Known parameters as display rows; ``resources`` maps id -> {title, kind}."""
    if not isinstance(params, dict):
        return []
    rows = []
    if kind == "subtitle_style":
        for key, label, unit in SUBTITLE_ROWS:
            node = params.get(key)
            if node is None:
                continue
            if key == "font":
                ref = node.get("resource") if isinstance(node, dict) else None
                value = (f"{resources[ref]['title']}({ref})" if ref in resources else ref) if ref else (node or {}).get("family")
                rows.append(_row(key, label, str(value or "—"), "", node))
            elif key == "band":
                band = _band(params)
                value = f"y {band['y_top']}–{band['y_bot']}" if band else "—"
                rows.append(_row(key, label, value, unit if band else "", node))
            elif key.endswith("_color"):
                raw = node.get("value") if isinstance(node, dict) else node
                rows.append(_row(key, label, str(raw), "", node, ass_to_hex(raw)))
            else:
                value = node.get("value") if isinstance(node, dict) else node
                rows.append(_row(key, label, str(value), unit, node))
    elif kind == "packaging":
        studio = params.get("studio_plan") if isinstance(params.get("studio_plan"), dict) else None
        layers = params.get("layers") if isinstance(params.get("layers"), list) else []
        if studio:
            preset_labels = {
                "portrait_stage": "竖屏舞台 9:16",
                "portrait_cinema": "竖屏影院 9:16",
                "landscape_cinema": "横屏影院 16:9",
            }
            backdrop_labels = {"blurred_frame": "动态虚化底", "solid": "纯净暗底"}
            preset = str(studio.get("preset") or "")
            rows.append(_row("preset", "版式", preset_labels.get(preset, preset or "—"), "", None))
            if studio.get("backdrop"):
                bd = str(studio["backdrop"])
                rows.append(_row("backdrop", "底图", backdrop_labels.get(bd, bd), "", None))
            if studio.get("palette"):
                rows.append(_row("palette", "色板", str(studio["palette"]), "", None))
            if layers:
                rows.append(_row("layers", "叠加图层", str(len(layers)), "层", None))
        else:
            rows.append(_row("layers", "图层", str(len(layers)), "层", None))
        if "safe_rect" in params:
            rows.append(_row("safe_rect", "安全区", _rect_text(params["safe_rect"]), "px", params["safe_rect"]))
    return rows


def _pct(value, total) -> float:
    return round(value / total * 100, 3) if total else 0.0


def _subtitle_preview(canvas: dict, params: dict) -> dict:
    width, height = canvas["width"], canvas["height"]
    size, per_line = _number(params, "size_px"), _number(params, "max_chars")
    band = _band(params)
    primary_node = params.get("primary_color")
    primary_raw = primary_node.get("value") if isinstance(primary_node, dict) else primary_node
    chars = int(per_line) if per_line else 0
    sample = (SAMPLE_TEXT * (chars // len(SAMPLE_TEXT) + 1))[:chars]
    margin_v = height - band["y_bot"] if band else None
    return {
        "type": "subtitle_style", "canvas": {"width": width, "height": height},
        "band": ({"top": _pct(band["y_top"], height), "height": _pct(band["y_bot"] - band["y_top"], height)}
                 if band else None),
        "line": {"text": sample, "chars": chars,
                 "font_size": _pct(size, width) if size else None,  # percent of canvas width
                 "bottom": _pct(margin_v, height) if margin_v is not None else None,
                 "width_px": size * chars if size and chars else None,
                 "usable_px": width - 2 * SIDE_MARGIN_PX,
                 "color": ass_to_hex(primary_raw)},
        "band_px": band, "margin_v": margin_v, "side": _pct(SIDE_MARGIN_PX, width),
    }


def _box(rect, canvas) -> dict | None:
    if not isinstance(rect, dict) or not all(isinstance(rect.get(k), (int, float)) for k in ("x", "y", "width", "height")):
        return None
    return {"left": _pct(rect["x"], canvas["width"]), "top": _pct(rect["y"], canvas["height"]),
            "width": _pct(rect["width"], canvas["width"]), "height": _pct(rect["height"], canvas["height"])}


def _packaging_preview(root: Path, canvas: dict, params: dict, resources: dict) -> dict:
    layers = []
    for layer in params.get("layers") if isinstance(params.get("layers"), list) else []:
        if not isinstance(layer, dict):
            continue
        ref = (layer.get("image") or {}).get("resource") if isinstance(layer.get("image"), dict) else None
        resource = resources.get(ref) or {}
        files = resource.get("files") or []
        layers.append({"name": layer.get("name"), "rect": layer.get("rect"), "rect_text": _rect_text(layer.get("rect")),
                       "box": _box(layer.get("rect"), canvas), "resource": ref, "title": resource.get("title"),
                       "media": media_entry(root, Path(files[0]["path"])) if files else None})
    studio = params.get("studio_plan") if isinstance(params.get("studio_plan"), dict) else None
    studio_preview = None
    if studio:
        preset = str(studio.get("preset") or "")
        vp = studio.get("viewport")
        if not isinstance(vp, dict):
            cw, ch = canvas["width"], canvas["height"]
            if preset == "portrait_stage":
                vp = {"x": 0, "y": round(436 * ch / 1920), "width": cw, "height": round(cw * 3 / 4)}
            elif preset == "portrait_cinema":
                hh, fh = round(184 * ch / 1920), round(188 * ch / 1920)
                vp = {"x": 0, "y": hh, "width": cw, "height": max(2, ch - hh - fh)}
            else:
                vp = {"x": 0, "y": 0, "width": cw, "height": ch}
        studio_preview = {
            "preset": preset,
            "backdrop": str(studio.get("backdrop") or ""),
            "viewport": _box(vp, canvas),
        }
    return {"type": "packaging", "canvas": {"width": canvas["width"], "height": canvas["height"]},
            "safe": _box(params.get("safe_rect"), canvas), "layers": layers, "studio": studio_preview}


def template_preview(root: Path, kind: str, canvas, params, resources: dict) -> dict | None:
    """Geometry for the mini canvas, in percent of the template canvas; None when unusable."""
    if not (isinstance(canvas, dict) and isinstance(params, dict)
            and all(isinstance(canvas.get(k), int) and canvas[k] > 0 for k in ("width", "height"))):
        return None
    if kind == "subtitle_style":
        return _subtitle_preview(canvas, params)
    if kind == "packaging":
        return _packaging_preview(root, canvas, params, resources)
    return None
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