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/sentence_gate.py

View on GitHub
"""The sentence-boundary gate: may a clip edge cut the source audio here?

Every audible clip edge must rest on the source start/end, a sentence or quiet pause, a
lossless same-source join, or outside detected speech. A blocked edge names the nearest
safe edge times on either side.
"""


def _unverified_window(row):
    return row.get("boundary_use") == "unverified"


def _same_source(left, right):
    # Single-source normalized plans omit source identity; both sides then read as None.
    return left.get("source_id") == right.get("source_id") and left.get(
        "source_path"
    ) == right.get("source_path")


def _continuous_source_join(left, right, tolerance=0.05):
    """`right` plays straight on from `left` with no media removed between them.

    Plan neighbours only: a per-source sub-plan (multi-source snapping) packs clips that
    another source's clip separates in the real plan, so consecutive clip_ids are required.
    """
    return (
        right.get("clip_id", 1) - left.get("clip_id", 0) == 1
        and _same_source(left, right)
        and abs(left["source_end"] - right["source_start"]) <= tolerance
        and abs(left["output_end"] - right["output_start"]) <= tolerance
    )


def _edge_joined(clips, idx, edge, tolerance=0.05):
    """Whether clips[idx]'s `edge` is a continuous same-source join with its plan neighbour."""
    if edge == "start":
        return idx > 0 and _continuous_source_join(clips[idx - 1], clips[idx], tolerance)
    return idx + 1 < len(clips) and _continuous_source_join(clips[idx], clips[idx + 1], tolerance)


# How far either side of a blocked edge the gate looks for a safe edge to suggest.
_SAFE_EDGE_SEARCH_SECONDS = 5.0
# How close to a pause window or speech span an edge counts as on it.
_GATE_TOLERANCE = 0.05
# The longest first-video-frame delay still waived as the source start. Typical mp4 offsets
# are a few ms; a capture whose picture begins later than this has real audio before it.
_VIDEO_START_WAIVER_SECONDS = 0.2


def _edge_classifier(boundary_windows, speech_spans, video_duration, tolerance,
                     video_start=0.0):
    """classify(edge, ts, contiguous) -> (status, reason) under the sentence-boundary gate.

    `video_start` is the source's first video frame (seconds after the file start): a clip
    cannot start any earlier on the picture, so a start up to it is the source start. Only
    up to `_VIDEO_START_WAIVER_SECONDS`: a later first frame (a TS capture whose picture
    starts 1.5 s into the audio) gets the normal speech rules, so a start moved onto it
    that lands mid-sentence still blocks.
    """
    verified_windows = [row for row in boundary_windows if not _unverified_window(row)]
    unverified_windows = [row for row in boundary_windows if _unverified_window(row)]
    source_start = video_start if video_start <= _VIDEO_START_WAIVER_SECONDS else 0.0

    def inside(rows, ts):
        return any(row["start"] - tolerance <= ts <= row["end"] + tolerance for row in rows)

    def classify(edge, ts, contiguous=False):
        if edge == "start" and ts <= source_start + tolerance:
            return "safe", "source_start"
        if edge == "end" and ts >= video_duration - tolerance:
            return "safe", "source_end"
        if contiguous:
            return "safe", "continuous_source_join"
        if inside(verified_windows, ts):
            return "safe", "sentence_or_quiet_boundary"
        if inside(unverified_windows, ts) and (not speech_spans or inside(speech_spans, ts)):
            # Word-safe pause, but the sentence end is only a coarse-ASR estimate.
            return "safe", "unverified_sentence_boundary"
        if not speech_spans:
            return "unchecked", "speech_timing_unavailable"
        if not inside(speech_spans, ts):
            return "safe", "outside_detected_speech"
        return "blocking", "inside_detected_speech"

    return classify


def _nearest_safe_edges(classify, edge, clip, boundary_windows, speech_spans, video_duration,
                        tolerance, frame_snap=None):
    """The closest safe edge times before and after a blocked edge, within the search span.

    Candidates are pause-window bounds, the first instants clear of a speech span (past the
    gate tolerance), and the source start/end; each is re-checked with the gate itself and
    must leave the clip a positive length. With `frame_snap(edge, clip, ts)` (where the
    frame-grid pass would move that edge) each candidate is reported where it lands on the
    source frame grid, and only when that landing is safe too: a candidate between two frames
    (a speech start minus the 60 ms clearance is half a frame at 25 fps) is never handed back
    for the frame pass to re-decide, so sending the suggestion back cannot be blocked again or
    moved onto the other side of a source hard cut.
    """
    ts = clip["source_start"] if edge == "start" else clip["source_end"]

    def usable(when):
        if not 0.0 <= when <= video_duration or abs(when - ts) > _SAFE_EDGE_SEARCH_SECONDS:
            return False
        return when < clip["source_end"] if edge == "start" else when > clip["source_start"]

    margin = tolerance + 0.01
    candidates = {0.0, round(video_duration, 3)}
    for row in boundary_windows:
        candidates.update((row["start"], row["end"]))
    for row in speech_spans:
        candidates.update((row["start"] - margin, row["end"] + margin))
    safe = {}
    for when in sorted(round(c, 3) for c in candidates):
        if not usable(when) or classify(edge, when)[0] != "safe":
            continue
        if frame_snap is not None:
            when = round(frame_snap(edge, clip, when), 3)
        status, reason = classify(edge, when)
        if status == "safe" and usable(when):
            safe.setdefault(when, reason)
    before = [when for when in safe if when < ts]
    after = [when for when in safe if when > ts]

    def suggestion(when):
        return {"time": when, "reason": safe[when], "delta": round(when - ts, 3)}

    return {"before": suggestion(max(before)) if before else None,
            "after": suggestion(min(after)) if after else None}


def enforce_clip_sentence_boundaries(
    plan, boundary_windows, speech_spans, video_duration, tolerance=_GATE_TOLERANCE,
    video_start=0.0, frame_snap=None,
):
    """Block any audible clip edge that falls inside detected source speech.

    Safe edges are: source start (up to a prompt first video frame, `video_start`) and end, a
    sentence/quiet pause (`unverified_sentence_boundary` when only a coarse-ASR sentence
    estimate covers it), or a truly contiguous same-source join (no media is removed).
    Missing ASR timing degrades to `unchecked` rather than inventing speech. Once ASR says
    an edge is speech-owned, failure to snap is blocking, and the check names the nearest
    safe edge times on either side (`nearest_safe`, frame-checked through `frame_snap`).
    """
    clips = plan["clips"]
    checks, new_blockers = [], []
    classify = _edge_classifier(boundary_windows, speech_spans, video_duration, tolerance,
                                video_start)

    for idx, clip in enumerate(clips):
        for edge, ts in (("start", clip["source_start"]), ("end", clip["source_end"])):
            status, reason = classify(edge, ts, _edge_joined(clips, idx, edge, tolerance))
            check = {
                "clip_id": clip["clip_id"],
                "source_id": clip.get("source_id"),
                "edge": edge,
                "time": round(ts, 3),
                "status": status,
                "reason": reason,
            }
            if status == "blocking":
                check["nearest_safe"] = _nearest_safe_edges(
                    classify, edge, clip, boundary_windows, speech_spans, video_duration,
                    tolerance, frame_snap,
                )
            checks.append(check)
            if status == "blocking":
                new_blockers.append(
                    {
                        "code": "unsafe_clip_sentence_boundary",
                        **check,
                        "message": "剪辑边界仍落在原声讲话区间内,必须移动到句末锚点,不能截断原声句子。"
                        "nearest_safe 给出前后最近的安全边界时间。",
                    }
                )

    qc = plan.setdefault("qc", {})
    qc.setdefault("boundary_status", {})["sentence_checks"] = checks
    existing = [
        row
        for row in qc.get("blocking", [])
        if row["code"] != "unsafe_clip_sentence_boundary"
    ]
    if existing or new_blockers:
        qc["blocking"] = existing + new_blockers
    else:
        qc.pop("blocking", None)
    return plan
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