srt-from-script
Build an SRT subtitle file from a 3-shot short-drama script (ai-video-script OUTPUT FORMAT). Reads each SHOT_N block's DURATION_S + VOICEOVER, emits…
它会碰到什么
这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。
技能内容
srt-from-script
Parses an ai-video-script 3-shot script and writes an SRT subtitle file
whose cues track the script's VOICEOVER per shot, time-coded with
cumulative shot durations.
Inputs (with:)
| key | required | default | notes |
|---|---|---|---|
| script | yes | — | Full script text (the entire OUTPUT FORMAT block, including OVERVIEW + SHOT_1..N). Passed via stdin so the orchestrator does not need to write a temp file. |
| output_path | yes | — | Output .srt path. Parent dir created if missing. |
| gap_ms | no | 200 | Tail pad subtracted from each cue's end so the subtitle vanishes ~200 ms before the next shot starts — avoids cuts clipping mid-character. |
| leading_offset_ms | no | 0 | Shifts every cue forward by this many ms. Set to the cover/intro clip duration when the merged video prepends a title card before SHOT_1. |
Parsing rules
- A shot with
VOICEOVER: noneor empty contributes no SRT cue but its
DURATION_S still advances the timeline cursor.
- Cue language follows the script verbatim. Chinese stays Chinese,
English stays English — no translation.
- Cumulative timestamps: SHOT_1 starts at 00:00:00,000; SHOT_2 starts at
SHOT_1.duration; etc.
- End time of each cue = next-shot start −
gap_ms, clamped to ≥ 800 ms
after start so very short voiceover lines remain readable.
Output
Prints the absolute path of the written .srt on stdout.
The file is UTF-8 encoded so CJK voiceover lines survive when ffmpeg
reads them via the subtitles= filter.
Limits
- Assumes the script follows ai-video-script's strict OUTPUT FORMAT
(=== SHOT_N === blocks with DURATION_S: and VOICEOVER: fields).
Drift away from that format → zero cues, exit 1.
- 3-5 shots tested. Larger shot counts work but timestamps grow.
想直接用这个技能?
本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。
它属于哪个仓库
src/opensquilla/skills/bundled/srt-from-script/SKILL.md