video-to-shorts

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Video To Shorts

Video To Shorts

Dependencies

依赖项

/video-understand
is a prerequisite. Run it first so shorts use the validated source transcript and canonical timeline. Before starting, verify that it is installed. If it is not, warn the user that this prerequisite is missing and stop before processing media.
Require
ffmpeg
/
ffprobe
on PATH and Python with
Pillow
. Check them before processing media.
/video-understand
是前置依赖。首先运行它,以确保 Shorts 使用经过验证的源转录文本和标准时间线。 开始前,验证它是否已安装。如果未安装,警告用户缺少此前置依赖,并在处理媒体前停止。
要求
ffmpeg
/
ffprobe
位于 PATH 中,并要求 Python 环境中安装
Pillow
。在处理媒体前检查这些条件。

Scope

范围

This skill has two project phases:
  1. Plan before render: map the understood transcript to program time, author and approve candidates, and write
    work/shorts/shorts-plan.json
    . This phase writes no final video.
  2. Finalize after render: after every selected main-sequence edit is approved and the shared main delivery is verified, rerun
    plan.py
    to bind the same approved ranges to that delivery, then extract horizontal and optional vertical outputs.
It owns short candidate judgment, deterministic qualification, horizontal extraction, short-relative transcripts, and optional deterministic vertical delivery. It does not transcribe in project mode, change the main sequence, add captions/graphics, grade, publish, or perform continuous subject tracking.
Delivered Shorts are derivatives of
final/final-video.mp4
, but candidate planning precedes that file. Record the operation in the project DAG, but never add it to
sequences.main.operations
; the main delivery and its original-vs-final comparison remain unchanged.
此 skill 包含两个项目阶段:
  1. 渲染前规划: 将已理解的转录文本映射到 program time,编写并审批候选内容,然后写入
    work/shorts/shorts-plan.json
    。此阶段不生成最终视频。
  2. 渲染后定稿: 在所有选定的主序列编辑均已审批且共享主交付已验证后,重新运行
    plan.py
    ,将同一批已审批范围绑定到该交付,然后提取横版输出和可选的竖版输出。
它负责短视频候选判断、确定性资格判定、横版提取、相对于短视频的转录文本,以及可选的确定性竖版交付。它不在项目模式下执行转录,不修改主序列,不添加字幕/图形,不进行调色,不发布,也不执行连续主体跟踪。
交付的 Shorts 是
final/final-video.mp4
的衍生内容,但候选规划先于该文件。在项目 DAG 中记录此操作,但绝不将其加入
sequences.main.operations
;主交付及其原始版与最终版对比保持不变。

Project Inputs

项目输入

  • work/project.json
  • the project source recorded by
    project.source.path
  • work/understand/transcript.json
    in source time
  • work/timeline.json
  • active main-operation revisions at each phase
Planning does not require
final/final-video.mp4
. Finalization and extraction require that exact project render with
render.status: verified
.
prepare_transcript.py --timeline
calls the shared
projectlib.map_transcript_to_timeline
. Candidate/extraction times are therefore program seconds on the actual final video. Words removed by the main edit are not available to shorts. Each retained word keeps its
source_range
,
program_range
, and
clip_id
.
Project transcript metadata binds the project source, source transcript, and timeline by absolute path, size, modified time, and SHA-256. Candidate review frames map their program timestamps back through
timeline.json
to the source video. Candidate validation refuses a changed binding.
  • work/project.json
  • work/project.json
    中
    project.source.path
    记录的项目源
  • 处于源时间的
    work/understand/transcript.json
  • work/timeline.json
  • 各阶段生效的主操作修订
规划不需要
final/final-video.mp4
。定稿和提取需要该项目的确切渲染结果,且其
render.status: verified
。
prepare_transcript.py --timeline
调用共享的
projectlib.map_transcript_to_timeline
。因此,候选/提取时间均为实际最终视频上的 program seconds。主编辑移除的词语不可用于 Shorts。每个保留词语都会保留其
source_range
、
program_range
和
clip_id
。
项目转录元数据通过绝对路径、大小、修改时间和 SHA-256 绑定项目源、源转录文本与时间线。候选审核帧通过
timeline.json
将其 program 时间戳映射回源视频。候选验证会拒绝已变更的绑定。

Output Layout

输出布局

text
work/shorts/
|-- transcript.json
|-- transcript_metadata.json
|-- candidates.json
|-- shorts-plan.json
|-- review/
|   |-- candidate_review.json
|   `-- approved_candidates.json
`-- short-001/
    |-- transcript.json
    |-- extraction-report.json
    `-- vertical-agent/
        |-- agent_vertical_plan.json
        |-- vertical_plan.json
        `-- review/vertical_review.json

work/cache/shorts/                 # disposable frames/sheets/intermediate media

review/06-shorts/
|-- candidates-<review-id>.html              # immutable authoritative page
|-- candidates-<review-id>-question.md
|-- assets/candidates-<review-id>/            # immutable start/middle/end frames
|-- candidates.html                           # non-authoritative latest alias
|-- candidates-summary.md
|-- short-001-horizontal.jpg
|-- short-001-vertical-preview.mp4
|-- short-001-vertical-contact-sheet.jpg
|-- short-001-vertical-preview-summary.json
|-- short-001-vertical-preview-probe.json
|-- <short-id>-vertical-review-<review-id>.html # immutable authoritative page
|-- <short-id>-vertical-review-<review-id>-question.md
|-- <short-id>-vertical-review.html             # non-authoritative latest alias
|-- <short-id>-vertical-review-assets/
|   `-- <review-id>/                             # immutable authoritative evidence
|       |-- preview.mp4                          # absent for REVIEW_REQUIRED
|       |-- contact-sheet.jpg                    # absent for REVIEW_REQUIRED
|       |-- preview-summary.json
|       `-- media-probe.json
`-- shorts-summary.md

final/shorts/
|-- short-001-horizontal.mp4
`-- short-001-vertical.mp4          # only when selected and approved
text
work/shorts/
|-- transcript.json
|-- transcript_metadata.json
|-- candidates.json
|-- shorts-plan.json
|-- review/
|   |-- candidate_review.json
|   `-- approved_candidates.json
`-- short-001/
    |-- transcript.json
    |-- extraction-report.json
    `-- vertical-agent/
        |-- agent_vertical_plan.json
        |-- vertical_plan.json
        `-- review/vertical_review.json

work/cache/shorts/                 # disposable frames/sheets/intermediate media

review/06-shorts/
|-- candidates-<review-id>.html              # immutable authoritative page
|-- candidates-<review-id>-question.md
|-- assets/candidates-<review-id>/            # immutable start/middle/end frames
|-- candidates.html                           # non-authoritative latest alias
|-- candidates-summary.md
|-- short-001-horizontal.jpg
|-- short-001-vertical-preview.mp4
|-- short-001-vertical-contact-sheet.jpg
|-- short-001-vertical-preview-summary.json
|-- short-001-vertical-preview-probe.json
|-- <short-id>-vertical-review-<review-id>.html # immutable authoritative page
|-- <short-id>-vertical-review-<review-id>-question.md
|-- <short-id>-vertical-review.html             # non-authoritative latest alias
|-- <short-id>-vertical-review-assets/
|   `-- <review-id>/                             # immutable authoritative evidence
|       |-- preview.mp4                          # absent for REVIEW_REQUIRED
|       |-- contact-sheet.jpg                    # absent for REVIEW_REQUIRED
|       |-- preview-summary.json
|       `-- media-probe.json
`-- shorts-summary.md

final/shorts/
|-- short-001-horizontal.mp4
`-- short-001-vertical.mp4          # only when selected and approved

Program Transcript

项目转录文本

Run from the repository root:
powershell
$RepoRoot = (Resolve-Path ".").Path
$SkillRoot = Join-Path $RepoRoot "skills\video-to-shorts"
$ProjectRoot = (Resolve-Path "<project-root>").Path
$Work = Join-Path $ProjectRoot "work"
$ShortsWork = Join-Path $Work "shorts"
$ProjectSource = (Resolve-Path "<project-source-from-work/project.json>").Path
$FinalVideo = Join-Path $ProjectRoot "final\final-video.mp4"
$ShortsReview = Join-Path $ProjectRoot "review\06-shorts"
New-Item -ItemType Directory -Force $ShortsWork,$ShortsReview | Out-Null

python "$SkillRoot\scripts\prepare_transcript.py" $ProjectSource `
  --transcript "$Work\understand\transcript.json" `
  --timeline "$Work\timeline.json" `
  --out $ShortsWork
Project timeline mode requires the canonical supplied transcript. Standalone mode may omit
--timeline
; it keeps input-relative time and may use the temporary
video-understand/scripts/transcribe.py
fallback. No transcript is auto-discovered.
从仓库根目录运行:
powershell
$RepoRoot = (Resolve-Path ".").Path
$SkillRoot = Join-Path $RepoRoot "skills\video-to-shorts"
$ProjectRoot = (Resolve-Path "<project-root>").Path
$Work = Join-Path $ProjectRoot "work"
$ShortsWork = Join-Path $Work "shorts"
$ProjectSource = (Resolve-Path "<project-source-from-work/project.json>").Path
$FinalVideo = Join-Path $ProjectRoot "final\final-video.mp4"
$ShortsReview = Join-Path $ProjectRoot "review\06-shorts"
New-Item -ItemType Directory -Force $ShortsWork,$ShortsReview | Out-Null

python "$SkillRoot\scripts\prepare_transcript.py" $ProjectSource `
  --transcript "$Work\understand\transcript.json" `
  --timeline "$Work\timeline.json" `
  --out $ShortsWork
项目时间线模式要求使用标准提供的转录文本。独立模式可以省略
--timeline
;它保留相对于输入的时间,并可使用临时的
video-understand/scripts/transcribe.py
作为回退。系统不会自动发现转录文本。

Candidate Authoring

候选内容编写

Generate long-video visual context into cache, inspect every sheet needed for a decision, and hand-author candidate JSON. Deterministic code validates editorial judgment; it does not invent candidates or scores.
powershell
python "$SkillRoot\scripts\prepare_visual_context.py" $ProjectSource `
  --timeline "$Work\timeline.json" `
  --out "$Work\cache\shorts\candidate-visual" --interval 15
Candidate input remains
shorts-candidates.v2
for compatibility. Set
selection.evidence_mode
and every candidate
evidence_mode
to
text_visual
. Each candidate requires:
  • stable
    candidate_id
    , title, and scene type;
  • complete
    start_time
    /
    end_time
    in program time;
  • transcript_excerpt
    exactly equal to overlapping transcript words, not whole overlapping segments;
  • all six score entries and non-empty reasons;
  • non-empty
    metadata.editorial_reason
    ;
  • optional reviewed
    filler_drop_spans
    and visual evidence fields.
Do not supply total
score
; the validator adds the six dimensions:
DimensionMaximum
hook
20
completeness
20
audience_value
20
emotion_tension
15
quotability
15
pace_editability
10
Prefer a complete, independently understandable thought over a shorter fragment. Keep a dependent interviewer question, premise, claim support, reversal, or payoff when it is necessary. Boundaries must land on whole words and thoughts.
Validate the authored file:
powershell
$CandidateDir = Join-Path $ShortsWork "preview\text_visual"
python "$SkillRoot\scripts\candidates.py" `
  --out $CandidateDir `
  --candidates "$CandidateDir\candidate-input.json" `
  --transcript "$ShortsWork\transcript.json" `
  --project-root $ProjectRoot
This writes the compatibility preview files, durable
work/shorts/candidates.json
, and
review/06-shorts/candidates.{html,summary.md}
.
将长视频的视觉上下文生成到缓存中,检查做出决策所需的每张图集,并手工编写候选 JSON。确定性代码用于验证编辑判断;它不会自行生成候选或评分。
powershell
python "$SkillRoot\scripts\prepare_visual_context.py" $ProjectSource `
  --timeline "$Work\timeline.json" `
  --out "$Work\cache\shorts\candidate-visual" --interval 15
候选输入格式仍为
shorts-candidates.v2
以保持兼容。将
selection.evidence_mode
和每个候选的
evidence_mode
均设置为
text_visual
。每个候选都需要:
  • 稳定的
    candidate_id
    、标题和场景类型;
  • 以 program time 表示的完整
    start_time
    /
    end_time
    ;
  • transcript_excerpt
    必须与重叠的转录词语完全相等,而不是整个重叠片段;
  • 六个评分项及非空理由;
  • 非空的
    metadata.editorial_reason
    ;
  • 可选的、经过审核的
    filler_drop_spans
    和视觉证据字段。
不要提供总计
score
;验证器会加上六个维度的分数:
维度最高分
hook
20
completeness
20
audience_value
20
emotion_tension
15
quotability
15
pace_editability
10
优先选择完整且可独立理解的想法,而不是更短的片段。必要时保留相互依赖的采访者问题、前提、主张支撑、反转或回报点。边界必须落在完整词语和完整思想的边界上。
验证手工编写的文件:
powershell
$CandidateDir = Join-Path $ShortsWork "preview\text_visual"
python "$SkillRoot\scripts\candidates.py" `
  --out $CandidateDir `
  --candidates "$CandidateDir\candidate-input.json" `
  --transcript "$ShortsWork\transcript.json" `
  --project-root $ProjectRoot
这会写入兼容性预览文件、持久文件
work/shorts/candidates.json
,以及
review/06-shorts/candidates.{html,summary.md}
。

Review Modes

审核模式

Candidate selection and delivery mode are one hash-bound gate. Delivery is exactly
horizontal_only
or
horizontal_and_vertical
.
Open the bound interactive page in human mode:
powershell
python "$SkillRoot\scripts\interaction.py" candidate-open --out $ShortsWork --review-out $ShortsReview
The command prints an authoritative review-ID-scoped page. The receipt binds that page, its candidate JSON, transcript, source media, fixed question, and every extracted frame by SHA-256.
candidates.html
is only a non-authoritative convenience alias to the latest page. Open the printed authoritative path with the current OS native command:
text
undefined
候选选择和交付模式构成一个基于哈希绑定的统一关卡。交付模式必须恰好为
horizontal_only
或
horizontal_and_vertical
。
在 human 模式下打开绑定的交互页面:
powershell
python "$SkillRoot\scripts\interaction.py" candidate-open --out $ShortsWork --review-out $ShortsReview
该命令会打印按 review ID 划分的权威页面。回执通过 SHA-256 将该页面及其候选 JSON、转录文本、源媒体、固定问题和每个提取帧绑定在一起。
candidates.html
只是指向最新页面的非权威便捷别名。使用当前操作系统原生命令打开打印出的权威路径:
text
undefined

Windows PowerShell

Windows PowerShell

Start-Process (Resolve-Path -LiteralPath "<printed-authoritative-page>")
Start-Process (Resolve-Path -LiteralPath "<printed-authoritative-page>")

macOS

macOS

open "<printed-authoritative-page>"
open "<printed-authoritative-page>"

Linux

Linux

xdg-open "<printed-authoritative-page>"
xdg-open "<printed-authoritative-page>"

Agent: Present the authoritative page and STOP.

Agent: Present the authoritative page and STOP.


If opening fails, retry the native command and report the failure if it still does
not open. Do not continue after presenting it. The page starts with all candidate
checkboxes and both delivery choices initially unselected. The user must select 1-5
candidates and one delivery mode. The bound page never silently selects candidates.

For approval, copy this exact page-generated structured summary unchanged into
`candidate-answer`:

```text
Shorts candidate review
Review: <review-id>
Candidates: text_visual/cand-001, text_visual/cand-002
Delivery: horizontal_and_vertical
For revision, copy this exact page-generated structured summary unchanged:
text
Shorts candidate review
Review: <review-id>
Decision: revise
Changes: <non-empty requested changes>
Record the later response without rewriting it:
powershell
python "$SkillRoot\scripts\interaction.py" candidate-answer `
  --out $ShortsWork --response-file "<verbatim-summary-file>"
When the user explicitly delegates decisions:
powershell
python "$SkillRoot\scripts\interaction.py" candidate-open `
  --out $ShortsWork --review-out $ShortsReview --decision-mode agent `
  --delegation-note "User delegated shorts selection and vertical approval."

python "$SkillRoot\scripts\interaction.py" candidate-agent-approve `
  --out $ShortsWork `
  --candidates "text_visual/cand-001" `
  --delivery horizontal_and_vertical `
  --rationale "The selected range has a self-contained hook, explanation, and payoff."
The Agent opens and inspects the same authoritative page, uses explicit candidate references, an explicit delivery mode, and a non-empty rationale. It never writes a fake human response or
user_response
. Human and Agent modes are mutually exclusive; human answer commands fail in Agent mode and Agent approval commands fail in human mode. Receipt verification rechecks review, page and media hashes. Regenerated source, candidate, transcript, page, question, frame, or approved-candidate artifacts invalidate approval.

如果打开失败,使用原生命令重试;如果仍无法打开,则报告失败。呈现页面后不要继续。页面开始时所有候选复选框和两种交付选项均未选中。用户必须选择 1–5 个候选和一种交付模式。绑定页面绝不会静默选择候选。

对于审批,将页面生成的以下结构化摘要原样复制到 `candidate-answer`:

```text
Shorts candidate review
Review: <review-id>
Candidates: text_visual/cand-001, text_visual/cand-002
Delivery: horizontal_and_vertical
对于修订,将页面生成的以下结构化摘要原样复制:
text
Shorts candidate review
Review: <review-id>
Decision: revise
Changes: <non-empty requested changes>
记录后续响应时不得改写:
powershell
python "$SkillRoot\scripts\interaction.py" candidate-answer `
  --out $ShortsWork --response-file "<verbatim-summary-file>"
当用户明确委托决策时:
powershell
python "$SkillRoot\scripts\interaction.py" candidate-open `
  --out $ShortsWork --review-out $ShortsReview --decision-mode agent `
  --delegation-note "User delegated shorts selection and vertical approval."

python "$SkillRoot\scripts\interaction.py" candidate-agent-approve `
  --out $ShortsWork `
  --candidates "text_visual/cand-001" `
  --delivery horizontal_and_vertical `
  --rationale "The selected range has a self-contained hook, explanation, and payoff."
Agent 打开并检查同一权威页面,使用明确的候选引用、明确的交付模式和非空理由。它绝不伪造人类响应或
user_response
。human 和 Agent 模式互斥;在 Agent 模式下,human answer 命令失败,在 human 模式下,Agent approval 命令失败。回执验证会重新检查审核、页面和媒体哈希。任何重新生成的源、候选、转录文本、页面、问题、帧或已审批候选工件都会使审批失效。

Canonical Plan

标准计划

powershell
python "$SkillRoot\scripts\plan.py" `
  --out $ShortsWork --project-root $ProjectRoot
work/shorts/shorts-plan.json
uses integer
schema_version: 1
. It records:
  • target: derived
    ,
    timebase: program
    , and
    timeline_id
    ;
  • delivery_status: awaiting_main_render
    during planning;
  • the project source and timeline bindings used for candidate review;
  • exact
    depends_on
    /
    based_on
    revisions from the active main sequence;
  • selection mode, rationale, delivery mode, and review ID;
  • stable short IDs;
  • explicit
    program_range
    and mapped
    source_ranges
    ;
  • scoring/editorial evidence, approved filler drops, and program-time keep spans;
  • work transcript/report paths and
    ../final/shorts/*.mp4
    delivery paths.
The first run is the end of the planning phase. Stop here and continue requested captions, content cards, graphic motion, and other remaining main-sequence operations in canonical order. Do not run
extract_shorts.py
and do not create
final.mp4
from this skill.
After the shared renderer verifies
final/final-video.mp4
, rerun the same
plan.py
command. It revalidates the approved project source and timeline, refreshes the full active-operation revisions, adds the verified main-render fingerprint, and sets
delivery_status: ready
. A timeline change requires new candidates and approval; pixel-only operations such as content cards and captions do not.
Qualification remains deterministic: score at least 70, completeness at least 15, estimated output duration 20-90 seconds, valid exact excerpt, no greater-than-50% overlap with a higher-ranked short, and at most five outputs unless configured.
Only isolated, semantically empty hesitation words with safe word boundaries may be approved as filler drops. Rejected/unsafe spans remain in the plan with reasons. Total removal may not exceed 15% and no keep span may be shorter than 0.15 seconds.
powershell
python "$SkillRoot\scripts\plan.py" `
  --out $ShortsWork --project-root $ProjectRoot
work/shorts/shorts-plan.json
使用整数
schema_version: 1
。它记录:
  • target: derived
    、
    timebase: program
    和
    timeline_id
    ;
  • 规划期间的
    delivery_status: awaiting_main_render
    ;
  • 候选审核所用的项目源和时间线绑定;
  • 来自生效主序列的确切
    depends_on
    /
    based_on
    修订;
  • 选择模式、理由、交付模式和 review ID;
  • 稳定的 short ID;
  • 明确的
    program_range
    和映射后的
    source_ranges
    ;
  • 评分/编辑证据、已审批的 filler drop,以及 program time 中的 keep span;
  • work 转录文本/报告路径和
    ../final/shorts/*.mp4
    交付路径。
第一次运行即规划阶段的结束点。到此停止,并按标准顺序继续执行所请求的字幕、内容卡片、图形动效及其他剩余主序列操作。不要运行
extract_shorts.py
,也不要通过此 skill 创建
final.mp4
。
共享渲染器验证
final/final-video.mp4
后,重新运行同一条
plan.py
命令。它会重新验证已审批的项目源和时间线,刷新全部生效操作修订,添加已验证主渲染的指纹,并设置
delivery_status: ready
。时间线变更需要新的候选和审批;内容卡片和字幕等仅影响像素的操作则不需要。
资格判定仍为确定性规则:总分至少 70,completeness 至少 15,预计输出时长为 20–90 秒,转录摘录精确有效,与排名更高的短视频重叠比例不得超过 50%,且除非另有配置,最多输出五个。
只有语义上孤立的空洞犹豫词且具有安全词语边界时,才可批准作为 filler drop。被拒绝或不安全的跨度会连同原因保留在计划中。移除总量不得超过 15%,且任何 keep span 都不得短于 0.15 秒。

Horizontal Extraction

横版提取

powershell
python "$SkillRoot\scripts\extract_shorts.py" `
  --video $FinalVideo --out $ShortsWork `
  --project-root $ProjectRoot
Before extraction, the script rechecks the main-render fingerprint, project render status, the complete current main-operation list and revisions, candidate receipt, approved candidate hash, and source video. An
awaiting_main_render
plan is rejected. Each keep range becomes its own seeked
-ss/-t/-i
input; ffmpeg concatenates those inputs and performs one H.264/AAC encode. It does not decode the complete main video once per keep range.
The selected final transcript word and the media cut endpoint are separate boundaries. Extraction preserves at least 0.25 seconds of release audio after selected content and targets 0.30 seconds.
--no-refine-boundaries
disables semantic phrase snapping only; it never disables the mandatory release handle. If the source ends before the required handle can be preserved, extraction fails instead of marking the short verified.
The short-relative transcript excludes dropped words, shifts later words onto a continuous zero-based clock, and retains input program/source evidence. Horizontal media goes directly to
final/shorts
; work contains only its transcript and report.
powershell
python "$SkillRoot\scripts\extract_shorts.py" `
  --video $FinalVideo --out $ShortsWork `
  --project-root $ProjectRoot
提取前,脚本会重新检查主渲染指纹、项目渲染状态、完整且当前的主操作列表和修订、候选回执、已审批候选哈希以及源视频。
awaiting_main_render
计划会被拒绝。每个 keep range 都成为独立执行 seek 的
-ss/-t/-i
输入;ffmpeg 拼接这些输入并执行一次 H.264/AAC 编码。它不会针对每个 keep range 将完整主视频解码一次。
最终转录文本中所选词语的边界与媒体剪切端点是两个独立边界。提取会在选定内容之后至少保留 0.25 秒的 release audio,目标为 0.30 秒。
--no-refine-boundaries
仅禁用语义短语吸附;它绝不会禁用必需的 release handle。如果源在无法保留所需 handle 之前结束,提取将失败,而不是将该短视频标记为已验证。
相对于短视频的转录文本会排除已删除词语,将后续词语移至连续的零基时钟,并保留输入的 program/source 证据。横版媒体直接写入
final/shorts
;work 中只保留其转录文本和报告。

Vertical Planning

竖版规划

Vertical delivery starts from the approved horizontal output. Generate dense visual evidence at 1 second, or 0.5 seconds when motion requires it. Inspect every sheet and author one of:
  • STATIC_CROP
    : one stable fixed 9:16 crop.
  • SCENE_CROP
    : scene-bounded fixed crops, with LETTERBOX only for scenes needing complete horizontal information.
  • LETTERBOX
    : complete sharp foreground over a blurred/darkened fill.
  • REVIEW_REQUIRED
    : evidence cannot support deterministic fixed crops; formal render is blocked.
Presenter scenes should keep the head and torso stable and large. Slides, products, groups, and diagrams must retain essential information. Do not claim continuous tracking. Crop changes belong at scene boundaries.
Each plan segment fully covers the short timeline, has a strategy, content type, non-empty rationale, and valid in-bounds crop when applicable. Required content types are
PRESENTER
,
WIDE_INFORMATION
,
PRODUCT
,
MULTI_SUBJECT
, and
OTHER
.
powershell
$ShortId = "short-001"
$Horizontal = Join-Path $ProjectRoot "final\shorts\$ShortId-horizontal.mp4"
$VerticalWork = Join-Path $ShortsWork "$ShortId\vertical-agent"
$ExtractionReport = Join-Path $ShortsWork "$ShortId\extraction-report.json"

python "$SkillRoot\scripts\prepare_visual_context.py" $Horizontal `
  --out "$Work\cache\shorts\$ShortId-vertical-visual" --interval 1

python "$SkillRoot\scripts\vertical_plan.py" `
  --video $Horizontal `
  --input "$VerticalWork\agent_vertical_plan.json" `
  --out $VerticalWork `
  --source-video $FinalVideo `
  --extraction-report $ExtractionReport
vertical_plan.json
preserves exact FPS as
{num, den}
and deterministically validates geometry, coverage, strategy duration, and warnings. The direct-render binding hashes the verified main delivery and the exact extraction report. Preview review still uses the approved horizontal short timeline, while formal rendering maps that timeline through the recorded
keep_spans
and reads pixels directly from the verified main delivery.
Render a smaller preview into the user-facing review directory:
powershell
python "$SkillRoot\scripts\render_vertical.py" `
  --video $Horizontal --plan "$VerticalWork\vertical_plan.json" `
  --out $VerticalWork --review-out $ShortsReview --mode preview
The command first writes flat latest convenience outputs named
<short-id>-vertical-preview.mp4
,
<short-id>-vertical-contact-sheet.jpg
,
<short-id>-vertical-preview-summary.json
, and
<short-id>-vertical-preview-probe.json
. It then prints the authoritative
<short-id>-vertical-review-<review-id>.html
page. The latest
<short-id>-vertical-review.html
alias is non-authoritative convenience only.
The authoritative page and receipt bind immutable review-ID-scoped copies under
<short-id>-vertical-review-assets/<review-id>/
:
preview.mp4
,
contact-sheet.jpg
,
preview-summary.json
, and
media-probe.json
. Later previews may replace the flat convenience outputs without changing an earlier receipt.
REVIEW_REQUIRED
stores only
preview-summary.json
and
media-probe.json
in its scoped directory because no preview video or contact sheet is rendered.
Open the printed authoritative path with the current OS native command:
text
undefined
竖版交付从已审批的横版输出开始。每 1 秒生成密集视觉证据;当运动需要时则每 0.5 秒生成。检查每张图集,并手工编写以下一种策略:
  • STATIC_CROP
    :一个稳定固定的 9:16 裁剪画面。
  • SCENE_CROP
    :按场景划分的固定裁剪;仅对需要完整横向信息的场景使用 LETTERBOX。
  • LETTERBOX
    :在模糊/变暗的填充背景上呈现完整且清晰的前景。
  • REVIEW_REQUIRED
    :证据无法支持确定性固定裁剪;阻止正式渲染。
主播场景应保持头部和躯干稳定且占据较大画面。幻灯片、产品、群体和图表必须保留关键信息。不得声称执行连续跟踪。裁剪变化必须发生在场景边界。
每个计划片段必须完整覆盖该短视频时间线,并包含策略、内容类型、非空理由,以及在适用时有效的边界内裁剪参数。必需内容类型为
PRESENTER
、
WIDE_INFORMATION
、
PRODUCT
、
MULTI_SUBJECT
和
OTHER
。
powershell
$ShortId = "short-001"
$Horizontal = Join-Path $ProjectRoot "final\shorts\$ShortId-horizontal.mp4"
$VerticalWork = Join-Path $ShortsWork "$ShortId\vertical-agent"
$ExtractionReport = Join-Path $ShortsWork "$ShortId\extraction-report.json"

python "$SkillRoot\scripts\prepare_visual_context.py" $Horizontal `
  --out "$Work\cache\shorts\$ShortId-vertical-visual" --interval 1

python "$SkillRoot\scripts\vertical_plan.py" `
  --video $Horizontal `
  --input "$VerticalWork\agent_vertical_plan.json" `
  --out $VerticalWork `
  --source-video $FinalVideo `
  --extraction-report $ExtractionReport
vertical_plan.json
将精确 FPS 保留为
{num, den}
,并确定性验证几何结构、覆盖范围、策略时长和警告。direct-render 绑定会对已验证主交付和确切提取报告进行哈希处理。预览审核仍使用已审批的横版短视频时间线,而正式渲染则通过记录的
keep_spans
映射该时间线,并直接从已验证主交付读取像素。
将较小的预览渲染到面向用户的审核目录:
powershell
python "$SkillRoot\scripts\render_vertical.py" `
  --video $Horizontal --plan "$VerticalWork\vertical_plan.json" `
  --out $VerticalWork --review-out $ShortsReview --mode preview
该命令首先写入扁平的最新便捷输出:
<short-id>-vertical-preview.mp4
、
<short-id>-vertical-contact-sheet.jpg
、
<short-id>-vertical-preview-summary.json
和
<short-id>-vertical-preview-probe.json
。随后打印权威的
<short-id>-vertical-review-<review-id>.html
页面。最新
<short-id>-vertical-review.html
alias 仅作为非权威便捷输出。
权威页面和回执会绑定
<short-id>-vertical-review-assets/<review-id>/
下的不可变、按 review ID 划分的副本:
preview.mp4
、
contact-sheet.jpg
、
preview-summary.json
和
media-probe.json
。后续预览可替换扁平的便捷输出,而不会改变早期回执。对于
REVIEW_REQUIRED
,范围目录中只存储
preview-summary.json
和
media-probe.json
,因为不会渲染预览视频或联系表。
打开打印出的权威路径:
text
undefined

Windows PowerShell

Windows PowerShell

Start-Process (Resolve-Path -LiteralPath "<printed-authoritative-page>")
Start-Process (Resolve-Path -LiteralPath "<printed-authoritative-page>")

macOS

macOS

open "<printed-authoritative-page>"
open "<printed-authoritative-page>"

Linux

Linux

xdg-open "<printed-authoritative-page>"
xdg-open "<printed-authoritative-page>"

Agent: Present the authoritative page and STOP.

Agent: Present the authoritative page and STOP.


If opening fails, retry the native command and report the failure if it still does
not open. Do not continue after presenting it. Inspect the complete preview,
contact sheet, all segments and crop/fit decisions, media probe, and every warning. The receipt hashes
the page, plan, source, preview, contact sheet, preview summary, probe, and fixed
question.

For human review, copy the page's exact structured summary unchanged into
`vertical-answer`. The three possible summaries are:

```text
Shorts vertical review
Short: <short-id>
Review: <review-id>
Decision: approve
text
Shorts vertical review
Short: <short-id>
Review: <review-id>
Decision: revise
Changes: <non-empty requested changes>
text
Shorts vertical review
Short: <short-id>
Review: <review-id>
Decision: skip
powershell
python "$SkillRoot\scripts\interaction.py" vertical-answer `
  --out $VerticalWork --response-file "<verbatim-summary-file>"
Delegated mode uses the same page and records an honest Agent decision with a non-empty rationale:
powershell
python "$SkillRoot\scripts\interaction.py" vertical-agent-approve `
  --out $VerticalWork `
  --rationale "All sampled scenes preserve the subject and essential information."
REVIEW_REQUIRED
offers only
revise
or
skip
; Agent approval is blocked. A newer candidate review invalidates an older vertical receipt. Final vertical rendering is allowed only after approval. Only approved, hash-matching review media and plans can reach final rendering; revision and skip never produce a final vertical file.
Formal render revalidates every approved artifact:
powershell
python "$SkillRoot\scripts\render_vertical.py" `
  --video $Horizontal --plan "$VerticalWork\vertical_plan.json" `
  --out $VerticalWork --review-out $ShortsReview --mode final
The formal renderer uses rational
num/den
, one H.264/yuv420p generation from the verified main delivery,
libx264 -preset slow -crf 16
, and encoded continuous audio. Preview rendering remains
medium
/ CRF 20 for faster review. The renderer checks dimensions, duration, FPS, audio presence, source/report hashes, and keep-span mapping.

如果打开失败,使用原生命令重试;如果仍无法打开,则报告失败。呈现页面后不要继续。检查完整预览、联系表、所有片段及裁剪/适配决策、媒体探针和每一条警告。回执会对页面、计划、源、预览、联系表、预览摘要、探针和固定问题进行哈希处理。

对于 human 审核,将页面的以下结构化摘要原样复制到 `vertical-answer`。共有三种可能的摘要:

```text
Shorts vertical review
Short: <short-id>
Review: <review-id>
Decision: approve
text
Shorts vertical review
Short: <short-id>
Review: <review-id>
Decision: revise
Changes: <non-empty requested changes>
text
Shorts vertical review
Short: <short-id>
Review: <review-id>
Decision: skip
powershell
python "$SkillRoot\scripts\interaction.py" vertical-answer `
  --out $VerticalWork --response-file "<verbatim-summary-file>"
委托模式使用同一页面,并记录带有非空理由的如实 Agent 决策:
powershell
python "$SkillRoot\scripts\interaction.py" vertical-agent-approve `
  --out $VerticalWork `
  --rationale "All sampled scenes preserve the subject and essential information."
REVIEW_REQUIRED
仅提供
revise
或
skip
;Agent 审批被阻止。较新的候选审核会使较旧的竖版回执失效。仅在审批后才允许最终竖版渲染。只有已审批且哈希匹配的审核媒体和计划才能进入最终渲染;revision 和 skip 永远不会生成最终竖版文件。
正式渲染会重新验证每个已审批工件:
powershell
python "$SkillRoot\scripts\render_vertical.py" `
  --video $Horizontal --plan "$VerticalWork\vertical_plan.json" `
  --out $VerticalWork --review-out $ShortsReview --mode final
正式渲染器使用有理数
num/den
,从已验证主交付执行一次 H.264/yuv420p 生成,采用
libx264 -preset slow -crf 16
,并编码连续音频。预览渲染仍使用
medium
/ CRF 20 以加快审核。渲染器会检查尺寸、时长、FPS、音频存在性、源/报告哈希和 keep span 映射。

Project Operation

项目操作

Add one derived operation to
work/project.json
, but not to the main sequence:
json
{
  "id": "shorts",
  "skill": "video-to-shorts",
  "revision": 1,
  "depends_on": ["understanding"],
  "based_on": {"understanding": 1},
  "status": "approved",
  "plan": "shorts/shorts-plan.json",
  "outputs": [],
  "target": {"sequence": "main", "scope": "derivatives"},
  "effects": {
    "changes_timeline": true,
    "changes_geometry": true,
    "changes_video_pixels": true,
    "changes_audio": true,
    "adds_track": null
  },
  "check": {"status": "pending", "report": "../review/06-shorts/shorts-summary.md"}
}
This is the pre-render state. Use the actual dependency list/revisions stored in the plan. After the shared main render, rerun
plan.py
, update the operation from the refreshed dependencies, extract and verify outputs, then set the operation/check to
verified
/
pass
and list the delivered files. Project validation checks the DAG and files; shorts remain outside the main render plan.
向
work/project.json
添加一个派生操作,但不要将其加入主序列:
json
{
  "id": "shorts",
  "skill": "video-to-shorts",
  "revision": 1,
  "depends_on": ["understanding"],
  "based_on": {"understanding": 1},
  "status": "approved",
  "plan": "shorts/shorts-plan.json",
  "outputs": [],
  "target": {"sequence": "main", "scope": "derivatives"},
  "effects": {
    "changes_timeline": true,
    "changes_geometry": true,
    "changes_video_pixels": true,
    "changes_audio": true,
    "adds_track": null
  },
  "check": {"status": "pending", "report": "../review/06-shorts/shorts-summary.md"}
}
这是渲染前状态。使用计划中存储的实际依赖列表/修订。共享主渲染后,重新运行
plan.py
,根据刷新后的依赖更新操作,提取并验证输出,然后将操作/check 设置为
verified
/
pass
并列出交付文件。项目验证会检查 DAG 和文件;Shorts 仍位于主渲染计划之外。

Compatibility

兼容性

Without
--project-root
, candidates and
shorts-plan.v2
keep their established standalone paths and input-relative time. The extractor accepts both plan shapes. Legacy
short_XX/source.mp4
vertical workflows and human review commands remain valid. Only the legacy unbound text review may use the default top five candidates; the bound interactive page always requires explicit selection. Standalone fallback transcription uses the canonical
video-understand
transcriber and a project-local model cache.
不使用
--project-root
时,候选和
shorts-plan.v2
保留其既有独立路径和相对于输入的时间。提取器接受两种计划结构。旧版
short_XX/source.mp4
竖版工作流和 human 审核命令仍然有效。只有旧版未绑定文本审核可使用默认前五个候选;绑定交互页面始终要求明确选择。独立模式回退转录使用标准
video-understand
转录器和项目本地模型缓存。

Self Check

自检

Run:
powershell
python "$SkillRoot\scripts\check_project_protocol.py"
python "$RepoRoot\skills\video-understand\scripts\validate.py" project `
  "$Work\project.json" $ProjectRoot
For every delivered short verify:
  • candidate excerpt equals overlapping program words and the thought is complete;
  • source/program ranges and dependency revisions resolve;
  • horizontal duration approximately equals keep-span sum;
  • short transcript starts at zero, ends within media, excludes removed words and words heard only inside the release handle, and reports
    tail_release_verified: true
    ;
  • horizontal output has expected FPS, H.264 video, synchronized audio, and review still;
  • vertical output is 9:16, uses the exact rational FPS, keeps required content safe, has synchronized audio, matches its approved preview/plan hashes, and records
    direct_render: true
    with the verified main delivery as
    render_source
    ;
  • all user-facing media is under
    review/
    or
    final/
    , and disposable material is under
    work/cache/
    ;
  • shorts-summary.md
    records outputs, decisions, warnings, and checks.
Page generation or JSON validation alone is not success. Watch the horizontal and vertical outputs and inspect their review images/contact sheets.
运行:
powershell
python "$SkillRoot\scripts\check_project_protocol.py"
python "$RepoRoot\skills\video-understand\scripts\validate.py" project `
  "$Work\project.json" $ProjectRoot
对每个已交付的短视频验证:
  • 候选摘录等于重叠的 program 词语,且想法完整;
  • 源/program 范围和依赖修订均可正确解析;
  • 横版时长约等于 keep span 总和;
  • 短视频转录文本从零开始,在媒体时长内结束,排除已移除词语以及仅在 release handle 内听到的词语,并报告
    tail_release_verified: true
    ;
  • 横版输出具有预期 FPS、H.264 视频、同步音频和审核静帧;
  • 竖版输出为 9:16,使用精确的有理数 FPS,使必需内容保持在安全区域,具有同步音频,与已审批预览/计划哈希匹配,并记录
    direct_render: true
    ,且以已验证主交付作为
    render_source
    ;
  • 所有面向用户的媒体均位于
    review/
    或
    final/
    下,临时材料位于
    work/cache/
    下;
  • shorts-summary.md
    记录输出、决策、警告和检查结果。
仅生成页面或通过 JSON 验证并不代表成功。观看横版和竖版输出,并检查其审核图像/联系表。