Agent Skillsopensquilla/opensquilla › subtitle-burner

subtitle-burner

GitHub

基于ffmpeg libass将SRT字幕烧录至MP4视频,支持CJK字体回退、H.264重编码及音频无损复制。专为Meta短剧后期设计,处理Windows路径转义,提供灵活的样式与分辨率配置。

src/opensquilla/skills/bundled/subtitle-burner/SKILL.md opensquilla/opensquilla

Trigger Scenarios

需要将SRT字幕嵌入视频文件 生成带硬字幕的最终MP4成品

Install

npx skills add opensquilla/opensquilla --skill subtitle-burner -g -y
More Options

Non-standard path

npx skills add https://github.com/opensquilla/opensquilla/tree/main/src/opensquilla/skills/bundled/subtitle-burner -g -y

Use without installing

npx skills use opensquilla/opensquilla@subtitle-burner

指定 Agent (Claude Code)

npx skills add opensquilla/opensquilla --skill subtitle-burner -a claude-code -g -y

安装 repo 全部 skill

npx skills add opensquilla/opensquilla --all -g -y

预览 repo 内 skill

npx skills add opensquilla/opensquilla --list

SKILL.md

Frontmatter
{
    "name": "subtitle-burner",
    "metadata": {
        "opensquilla": {
            "risk": "medium",
            "requires": {
                "bins": [
                    "ffmpeg"
                ],
                "anyBins": [
                    "python",
                    "python3"
                ]
            },
            "capabilities": [
                "filesystem-write",
                "process-control"
            ]
        }
    },
    "entrypoint": {
        "args": [
            "--input",
            "{{ with.input }}",
            "--subtitles",
            "{{ with.subtitles }}",
            "--output",
            "{{ with.output }}",
            "--font",
            "{{ with.font | default('Microsoft YaHei,SimHei,Arial Unicode MS,Arial') }}",
            "--font-size",
            "{{ with.font_size | default(42) }}",
            "--margin-v",
            "{{ with.margin_v | default(80) }}",
            "--play-res",
            "{{ with.play_res | default('auto') }}",
            "--crf",
            "{{ with.crf | default(20) }}",
            "--preset",
            "{{ with.preset | default('medium') }}"
        ],
        "parse": "text",
        "command": "python {baseDir}\/scripts\/burn.py",
        "timeout": 600
    },
    "provenance": {
        "origin": "opensquilla-original",
        "license": "Apache-2.0"
    },
    "description": "Burn an SRT subtitle file into an MP4 via ffmpeg's subtitles filter (libass). Single-pass re-encode of video; audio copied as-is. CJK-friendly font fallback chain (Microsoft YaHei → SimHei → Arial Unicode MS → Arial). Used by meta-short-drama as the final subtitling step after merge."
}

subtitle-burner

Burns an SRT subtitle stream into an MP4. The video is re-encoded (H.264 + faststart), the audio is copied untouched. libass renders the text per ASS-style override flags, so Chinese / Japanese / Korean characters survive when the host has any of the listed fallback fonts installed (on Windows, Microsoft YaHei and SimHei ship with the OS).

Inputs (with:)

key required default notes
input yes Source MP4 path.
subtitles yes .srt path (UTF-8).
output yes Output MP4 path. Parent dir created if missing.
font no Microsoft YaHei,SimHei,Arial Unicode MS,Arial libass FontName fallback chain. First wins.
font_size no 42 Font size. When play_res=auto this is in source-video pixels.
margin_v no 80 Bottom margin in source-video pixels (because play_res=auto sets PlayRes to the input W×H).
play_res no auto auto probes the input MP4 for resolution; or pass WxH like 720x1280. Setting this makes FontSize/MarginV act in source pixels rather than libass's 384×288 default.
crf no 20 x264 CRF (0-51, lower = better quality).
preset no medium x264 preset.

Output

Prints the absolute path of the subtitled MP4 on stdout. Non-zero exit on any ffmpeg failure; stderr tails the last 2.5 KB of the encoder log for diagnosis.

Dependencies

  • ffmpeg ≥ 5.0 (libass support is standard in any modern build).
  • Python 3.8+.

The script auto-locates ffmpeg via PATH; on Windows it falls back to the winget Gyan.FFmpeg / scoop / chocolatey install paths if PATH inheritance failed (matches the resolution logic in video-merger and video-still-animator).

Path-escaping notes

ffmpeg's subtitles= filter is picky on Windows:

  • Drive-letter colons (C:/…) must be backslash-escaped (C\:/…).
  • The path uses forward slashes regardless of host OS.
  • Single quotes inside the path get backslash-escaped.

The script applies these rules so callers don't have to.

Style chain

The force_style defaults render white text with a 2-px black outline on a transparent background (BorderStyle=3), bottom-centred, 80 px above the frame edge. Override any of the --* flags via with.* if you want a different look.

Version History

  • 7f72a32 Current 2026-07-05 18:40

Same Skill Collection

src/opensquilla/skills/bundled/advanced-dubbing-studio/SKILL.md
src/opensquilla/skills/bundled/ai-video-script/SKILL.md
src/opensquilla/skills/bundled/audio-cog/SKILL.md
src/opensquilla/skills/bundled/awesome-webpage-image-download/SKILL.md
src/opensquilla/skills/bundled/awesome-webpage-research/SKILL.md
src/opensquilla/skills/bundled/AwesomeWebpageMetaSkill/SKILL.md
src/opensquilla/skills/bundled/cron/SKILL.md
src/opensquilla/skills/bundled/docx/SKILL.md
src/opensquilla/skills/bundled/filesystem/SKILL.md
src/opensquilla/skills/bundled/git-diff/SKILL.md
src/opensquilla/skills/bundled/github/SKILL.md
src/opensquilla/skills/bundled/history-explorer/SKILL.md
src/opensquilla/skills/bundled/html-coder/SKILL.md
src/opensquilla/skills/bundled/html-to-pdf/SKILL.md
src/opensquilla/skills/bundled/http-fetch/SKILL.md
src/opensquilla/skills/bundled/latex-compile/SKILL.md
src/opensquilla/skills/bundled/memory/SKILL.md
src/opensquilla/skills/bundled/music-and-singing-studio/SKILL.md
src/opensquilla/skills/bundled/nano-banana-pro-openrouter/SKILL.md
src/opensquilla/skills/bundled/nano-banana-pro/SKILL.md
src/opensquilla/skills/bundled/nano-pdf/SKILL.md
src/opensquilla/skills/bundled/openrouter-video-generator/SKILL.md
src/opensquilla/skills/bundled/paper-abstract-author/SKILL.md
src/opensquilla/skills/bundled/paper-citation-planner/SKILL.md
src/opensquilla/skills/bundled/paper-experiment-stub/SKILL.md
src/opensquilla/skills/bundled/paper-outline-author/SKILL.md
src/opensquilla/skills/bundled/paper-preference-planner/SKILL.md
src/opensquilla/skills/bundled/paper-refbib-stub/SKILL.md
src/opensquilla/skills/bundled/paper-revision-author/SKILL.md
src/opensquilla/skills/bundled/paper-section-author/SKILL.md
src/opensquilla/skills/bundled/paper-source-curator/SKILL.md
src/opensquilla/skills/bundled/pptx/SKILL.md
src/opensquilla/skills/bundled/seedance-2-prompt/SKILL.md
src/opensquilla/skills/bundled/skill-creator-linter/SKILL.md
src/opensquilla/skills/bundled/skill-creator-proposals/SKILL.md
src/opensquilla/skills/bundled/skill-creator-smoke-test/SKILL.md
src/opensquilla/skills/bundled/srt-from-script/SKILL.md
src/opensquilla/skills/bundled/stack-trace-generic-probe/SKILL.md
src/opensquilla/skills/bundled/stack-trace-go-probe/SKILL.md
src/opensquilla/skills/bundled/stack-trace-js-probe/SKILL.md
src/opensquilla/skills/bundled/stack-trace-python-probe/SKILL.md
src/opensquilla/skills/bundled/stack-trace-rust-probe/SKILL.md
src/opensquilla/skills/bundled/swe-bench/SKILL.md
src/opensquilla/skills/bundled/text-file-read/SKILL.md
src/opensquilla/skills/bundled/title-card-image/SKILL.md
src/opensquilla/skills/bundled/video-merger/SKILL.md
src/opensquilla/skills/bundled/video-still-animator/SKILL.md
src/opensquilla/skills/bundled/voice-clone-lab/SKILL.md
src/opensquilla/skills/bundled/voice-conversion-studio/SKILL.md
src/opensquilla/skills/bundled/voiceover-studio/SKILL.md
src/opensquilla/skills/bundled/weather/SKILL.md
src/opensquilla/skills/bundled/web-search/SKILL.md
src/opensquilla/skills/bundled/xlsx/SKILL.md
src/opensquilla/skills/exp/meta-arxiv-daily-digest-deck/SKILL.md
src/opensquilla/skills/exp/meta-codereview-current-diff/SKILL.md
src/opensquilla/skills/exp/meta-compliance-audit-bundle/SKILL.md
src/opensquilla/skills/exp/meta-diagram-triangulation/SKILL.md
src/opensquilla/skills/exp/meta-github-pr-watch-digest/SKILL.md
src/opensquilla/skills/exp/meta-issue-to-pr-autopilot/SKILL.md
src/opensquilla/skills/exp/meta-knowledge-base-bootstrap/SKILL.md
src/opensquilla/skills/exp/meta-migration-assistant/SKILL.md
src/opensquilla/skills/exp/meta-multi-format-export-pack/SKILL.md
src/opensquilla/skills/exp/meta-pdf-intelligence/SKILL.md
src/opensquilla/skills/exp/meta-pdf-reformat-pipeline/SKILL.md
src/opensquilla/skills/exp/meta-pre-commit-quality-gate/SKILL.md
src/opensquilla/skills/exp/meta-scheduled-morning-digest/SKILL.md
src/opensquilla/skills/exp/meta-security-review-bundle/SKILL.md
src/opensquilla/skills/exp/meta-spreadsheet-insight/SKILL.md
src/opensquilla/skills/exp/meta-stack-trace-investigator/SKILL.md
src/opensquilla/skills/exp/meta-travel-planner/SKILL.md
src/opensquilla/skills/exp/meta-web-to-pdf-briefing/SKILL.md
tests/_fixtures/meta-paper-write-handwritten.SKILL.md
src/opensquilla/skills/bundled/code-task/SKILL.md
src/opensquilla/skills/bundled/deep-research/SKILL.md
src/opensquilla/skills/bundled/meta-kid-project-planner/SKILL.md
src/opensquilla/skills/bundled/meta-paper-write/SKILL.md
src/opensquilla/skills/bundled/meta-short-drama/SKILL.md
src/opensquilla/skills/bundled/meta-skill-creator/SKILL.md
src/opensquilla/skills/bundled/multi-search-engine/SKILL.md
src/opensquilla/skills/bundled/pdf-toolkit/SKILL.md
src/opensquilla/skills/bundled/skill-creator/SKILL.md
src/opensquilla/skills/bundled/sub-agent/SKILL.md
src/opensquilla/skills/bundled/summarize/SKILL.md
src/opensquilla/skills/bundled/tmux/SKILL.md
src/opensquilla/skills/exp/meta-long-running-build-watchdog/SKILL.md
src/opensquilla/skills/bundled/paper-plot-stub/SKILL.md
src/opensquilla/skills/exp/meta-content-publish-pipeline/SKILL.md
src/opensquilla/skills/exp/meta-home-it-rescue/SKILL.md
src/opensquilla/skills/exp/meta-meeting-to-workflow/SKILL.md
src/opensquilla/skills/exp/meta-research-to-slide-deck/SKILL.md
src/opensquilla/skills/exp/meta-sales-lead-researcher/SKILL.md

Metadata

Files
0
Version
7f72a32
Hash
f754a492
Indexed
2026-07-05 18:40

trang chủ - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-08 23:36
浙ICP备14020137号-1 $bản đồ khách truy cập$