omnicaptions-convert
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCaption Format Conversion
字幕格式转换
Convert between 30+ caption/caption formats using .
lattifai-captions使用 在30多种字幕格式之间进行转换。
lattifai-captions⚡ YouTube Workflow
⚡ YouTube 工作流
bash
undefinedbash
undefined1. Transcribe YouTube video directly
1. 直接转录YouTube视频
omnicaptions transcribe "https://youtube.com/watch?v=VIDEO_ID" -o transcript.md
omnicaptions transcribe "https://youtube.com/watch?v=VIDEO_ID" -o transcript.md
2. Convert to any format
2. 转换为任意格式
omnicaptions convert transcript.md -o output.srt
omnicaptions convert transcript.md -o output.ass
omnicaptions convert transcript.md -o output.vtt
undefinedomnicaptions convert transcript.md -o output.srt
omnicaptions convert transcript.md -o output.ass
omnicaptions convert transcript.md -o output.vtt
undefinedWhen to Use
适用场景
- Converting SRT to VTT, ASS, TTML, etc.
- Converting Gemini markdown transcript to standard caption formats
- Converting YouTube VTT (with word-level timestamps) to other formats
- Batch format conversion
- 将SRT转换为VTT、ASS、TTML等格式
- 将Gemini markdown转录稿转换为标准字幕格式
- 将带词级时间戳的YouTube VTT转换为其他格式
- 批量格式转换
When NOT to Use
不适用场景
- Need transcription (use )
/omnicaptions:transcribe - Need translation (use )
/omnicaptions:translate
- 需要转录功能(使用 )
/omnicaptions:transcribe - 需要翻译功能(使用 )
/omnicaptions:translate
Setup
安装配置
bash
pip install omni-captions-skillsbash
pip install omni-captions-skillsQuick Reference
快速参考
| Format | Extension | Read | Write |
|---|---|---|---|
| SRT | | ✓ | ✓ |
| VTT | | ✓ | ✓ |
| ASS/SSA | | ✓ | ✓ |
| TTML | | ✓ | ✓ |
| Gemini MD | | ✓ | ✓ |
| JSON | | ✓ | ✓ |
| TXT | | ✓ | ✓ |
Full list: SRT, VTT, ASS, SSA, TTML, DFXP, SBV, SUB, LRC, JSON, TXT, TSV, Audacity, Audition, FCPXML, EDL, and more.
| 格式 | 扩展名 | 可读 | 可写 |
|---|---|---|---|
| SRT | | ✓ | ✓ |
| VTT | | ✓ | ✓ |
| ASS/SSA | | ✓ | ✓ |
| TTML | | ✓ | ✓ |
| Gemini MD | | ✓ | ✓ |
| JSON | | ✓ | ✓ |
| TXT | | ✓ | ✓ |
完整格式列表:SRT、VTT、ASS、SSA、TTML、DFXP、SBV、SUB、LRC、JSON、TXT、TSV、Audacity、Audition、FCPXML、EDL等。
CLI Usage
CLI 使用方法
bash
undefinedbash
undefinedConvert (auto-output to same directory, only changes extension)
转换(自动输出到同一目录,仅更改扩展名)
omnicaptions convert input.srt -t vtt # → ./input.vtt
omnicaptions convert transcript.md # → ./transcript.srt
omnicaptions convert input.srt -t vtt # → ./input.vtt
omnicaptions convert transcript.md # → ./transcript.srt
Specify output file or directory
指定输出文件或目录
omnicaptions convert input.srt -o output/ # → output/input.srt
omnicaptions convert input.srt -o output.vtt # → output.vtt
omnicaptions convert input.srt -o output/ # → output/input.srt
omnicaptions convert input.srt -o output.vtt # → output.vtt
Specify format explicitly
显式指定格式
omnicaptions convert input.txt -o out.srt -f txt -t srt
undefinedomnicaptions convert input.txt -o out.srt -f txt -t srt
undefinedASS Style Presets
ASS 样式预设
When converting to ASS format, use to apply preset styles:
--stylebash
omnicaptions convert input.srt -o output.ass --style default # White text, bottom
omnicaptions convert input.srt -o output.ass --style top # White text, top
omnicaptions convert input.srt -o output.ass --style bilingual # White + Yellow (for bilingual)
omnicaptions convert input.srt -o output.ass --style yellow # Yellow text, bottom| Preset | Position | Line 1 | Line 2 | Use Case |
|---|---|---|---|---|
| Bottom | White | White | Standard captions |
| Top | White | White | When bottom is occupied |
| Bottom | White | Yellow | Bilingual captions (原文 + 译文) |
| Bottom | Yellow | Yellow | High visibility |
转换为ASS格式时,使用 参数应用预设样式:
--stylebash
omnicaptions convert input.srt -o output.ass --style default # 白色文字,底部显示
omnicaptions convert input.srt -o output.ass --style top # 白色文字,顶部显示
omnicaptions convert input.srt -o output.ass --style bilingual # 白色+黄色(用于双语字幕)
omnicaptions convert input.srt -o output.ass --style yellow # 黄色文字,底部显示| 预设 | 位置 | 第一行 | 第二行 | 适用场景 |
|---|---|---|---|---|
| 底部 | 白色 | 白色 | 标准字幕 |
| 顶部 | 白色 | 白色 | 底部区域被占用时 |
| 底部 | 白色 | 黄色 | 双语字幕(原文 + 译文) |
| 底部 | 黄色 | 黄色 | 高可见度需求 |
Bilingual Example
双语字幕示例
If your SRT has two-line captions like:
1
00:00:01,000 --> 00:00:03,000
Hello World
你好世界Use or custom colors:
--style bilingualbash
undefined如果你的SRT字幕包含两行内容,如下所示:
1
00:00:01,000 --> 00:00:03,000
Hello World
你好世界使用 或自定义颜色:
--style bilingualbash
undefinedPreset: white + yellow
预设:白色+黄色
omnicaptions convert bilingual.srt -o output.ass --style bilingual
omnicaptions convert bilingual.srt -o output.ass --style bilingual
Custom colors: green English + yellow Chinese
自定义颜色:绿色英文+黄色中文
omnicaptions convert bilingual.srt -o output.ass --line1-color "#00FF00" --line2-color "#FFFF00"
omnicaptions convert bilingual.srt -o output.ass --line1-color "#00FF00" --line2-color "#FFFF00"
Mix preset with custom line2 color
混合预设与自定义第二行颜色
omnicaptions convert bilingual.srt -o output.ass --style default --line2-color "#FF6600"
undefinedomnicaptions convert bilingual.srt -o output.ass --style default --line2-color "#FF6600"
undefinedCustom Color Options
自定义颜色选项
| Option | Description |
|---|---|
| First line (original) color |
| Second line (translation) color |
Common colors: (white), (yellow), (green), (cyan), (orange)
#FFFFFF#FFFF00#00FF00#00FFFF#FF6600| 选项 | 说明 |
|---|---|
| 第一行(原文)颜色 |
| 第二行(译文)颜色 |
常用颜色:(白色)、(黄色)、(绿色)、(青色)、(橙色)
#FFFFFF#FFFF00#00FF00#00FFFF#FF6600Font Size and Resolution
字体大小与分辨率
Font size is auto-calculated based on video resolution. Resolution is detected from (priority order):
- argument (e.g.,
--resolution,1080p,4k)1920x1080 - argument (uses ffprobe to detect)
--video - file (saved by
.meta.json)omnicaptions download - Default: 1080p
bash
undefined字体大小会根据视频分辨率自动计算。分辨率检测优先级如下:
- 参数(例如
--resolution、1080p、4k)1920x1080 - 参数(使用ffprobe检测)
--video - 文件(由
.meta.json保存)omnicaptions download - 默认值:1080p
bash
undefinedAuto-detect from .meta.json (saved by download command)
从.meta.json自动检测(由download命令保存)
omnicaptions convert abc123.en.srt -o abc123.en.ass --karaoke
omnicaptions convert abc123.en.srt -o abc123.en.ass --karaoke
Specify resolution directly
直接指定分辨率
omnicaptions convert input.srt -o output.ass --resolution 4k
omnicaptions convert input.srt -o output.ass --resolution 720p
omnicaptions convert input.srt -o output.ass --resolution 1920x1080
omnicaptions convert input.srt -o output.ass --resolution 4k
omnicaptions convert input.srt -o output.ass --resolution 720p
omnicaptions convert input.srt -o output.ass --resolution 1920x1080
Detect from video file (uses ffprobe)
从视频文件检测(使用ffprobe)
omnicaptions convert input.srt -o output.ass --video video.mp4
omnicaptions convert input.srt -o output.ass --video video.mp4
Override auto-calculated fontsize
覆盖自动计算的字体大小
omnicaptions convert input.srt -o output.ass --resolution 4k --fontsize 80
| Resolution | PlayRes | Auto FontSize |
|------------|---------|---------------|
| 480p | 854×480 | 24 |
| 720p | 1280×720 | 32 |
| 1080p | 1920×1080 | 48 (default) |
| 2K | 2560×1440 | 64 |
| 4K | 3840×2160 | 96 |omnicaptions convert input.srt -o output.ass --resolution 4k --fontsize 80
| 分辨率 | 播放分辨率 | 自动字体大小 |
|------------|---------|---------------|
| 480p | 854×480 | 24 |
| 720p | 1280×720 | 32 |
| 1080p | 1920×1080 | 48(默认) |
| 2K | 2560×1440 | 64 |
| 4K | 3840×2160 | 96 |Karaoke Mode
卡拉OK模式
Generate karaoke subtitles with word-level highlighting. Requires word-level timing (use LaiCut alignment first).
bash
undefined生成带词级高亮的卡拉OK字幕。需要词级时间戳(先使用LaiCut对齐)。
bash
undefinedBasic karaoke (sweep effect - gradual fill)
基础卡拉OK(扫过效果 - 逐渐填充)
omnicaptions convert lyrics_LaiCut.json -o lyrics_LaiCut_karaoke.ass --karaoke
omnicaptions convert lyrics_LaiCut.json -o lyrics_LaiCut_karaoke.ass --karaoke
Different effects
不同效果
omnicaptions convert lyrics_LaiCut.json -o lyrics_LaiCut_karaoke.ass --karaoke sweep # Gradual fill (default)
omnicaptions convert lyrics_LaiCut.json -o lyrics_LaiCut_karaoke.ass --karaoke instant # Instant highlight
omnicaptions convert lyrics_LaiCut.json -o lyrics_LaiCut_karaoke.ass --karaoke outline # Outline then fill
omnicaptions convert lyrics_LaiCut.json -o lyrics_LaiCut_karaoke.ass --karaoke sweep # 逐渐填充(默认)
omnicaptions convert lyrics_LaiCut.json -o lyrics_LaiCut_karaoke.ass --karaoke instant # 即时高亮
omnicaptions convert lyrics_LaiCut.json -o lyrics_LaiCut_karaoke.ass --karaoke outline # 先轮廓填充,再文字填充
LRC karaoke (enhanced word timestamps)
LRC卡拉OK(增强词级时间戳)
omnicaptions convert lyrics_LaiCut.json -o lyrics_LaiCut_karaoke.lrc --karaoke
| Effect | ASS Tag | Description |
|--------|---------|-------------|
| `sweep` | `\kf` | Gradual fill from left to right (default) |
| `instant` | `\k` | Instant word highlight |
| `outline` | `\ko` | Outline fills, then text fills |omnicaptions convert lyrics_LaiCut.json -o lyrics_LaiCut_karaoke.lrc --karaoke
| 效果 | ASS 标签 | 说明 |
|--------|---------|-------------|
| `sweep` | `\kf` | 从左到右逐渐填充(默认) |
| `instant` | `\k` | 即时高亮单词 |
| `outline` | `\ko` | 先填充轮廓,再填充文字 |Karaoke Workflow
卡拉OK工作流
bash
undefinedbash
undefined1. Align with LaiCut (get word-level timing in JSON)
1. 使用LaiCut对齐(在JSON中获取词级时间戳)
omnicaptions LaiCut audio.mp3 lyrics.txt
omnicaptions LaiCut audio.mp3 lyrics.txt
2. Convert to karaoke ASS
2. 转换为卡拉OK ASS格式
omnicaptions convert lyrics_LaiCut.json -o karaoke.ass --karaoke
omnicaptions convert lyrics_LaiCut.json -o karaoke.ass --karaoke
Or combine with style
或结合样式使用
omnicaptions convert lyrics_LaiCut.json -o karaoke.ass --karaoke --style yellow
undefinedomnicaptions convert lyrics_LaiCut.json -o karaoke.ass --karaoke --style yellow
undefinedPython Usage
Python 使用方法
python
from omnicaptions import Captionpython
from omnicaptions import CaptionLoad any format
加载任意格式
cap = Caption.read("input.srt")
cap = Caption.read("input.srt")
Write to any format
写入任意格式
cap.write("output.vtt")
cap.write("output.ass")
cap.write("output.ttml")
undefinedcap.write("output.vtt")
cap.write("output.ass")
cap.write("output.ttml")
undefinedCommon Mistakes
常见问题
| Mistake | Fix |
|---|---|
| Format not detected | Use |
| Missing timestamps | Source format must have timing info |
| Encoding error | Specify |
| 问题 | 解决方法 |
|---|---|
| 格式未被检测到 | 使用 |
| 缺少时间戳 | 源格式必须包含时间信息 |
| 编码错误 | 指定 |
Related Skills
相关技能
| Skill | Use When |
|---|---|
| Need transcript from audio/video |
| Translate with Gemini API |
| Translate with Claude (no API key) |
| Download video/captions first |
| 技能 | 适用场景 |
|---|---|
| 需要从音频/视频生成转录稿 |
| 使用Gemini API进行翻译 |
| 使用Claude进行翻译(无需API密钥) |
| 先下载视频/字幕 |
Workflow Examples
工作流示例
undefinedundefinedTranscribe → Convert → Translate (with Claude)
转录 → 转换 → 翻译(使用Claude)
/omnicaptions:transcribe video.mp4
/omnicaptions:convert video_GeminiUnd.md -o video.srt
/omnicaptions:translate video.srt -l zh --bilingual
undefined/omnicaptions:transcribe video.mp4
/omnicaptions:convert video_GeminiUnd.md -o video.srt
/omnicaptions:translate video.srt -l zh --bilingual
undefined