mcpField
O
omnicaptions-convert

omnicaptions-convert

github.com/lattifaiクリエイティブ・メディア22120 回インストール38 週間前に更新
リポジトリ

omnicaptions-convert について

omnicaptions-convert は、字幕ファイルを 30 種類以上の形式に変換するスキルです。ASS のスタイル設定や、単語単位のタイミング情報を使ったカラオケ字幕の生成にも対応します。

主な機能

  1. 0130 種類以上の字幕形式を変換
  2. 02ファイルの一括変換
  3. 03ASS のプリセットと色の指定
  4. 04単語ハイライト付きカラオケ出力

活用シーン

  1. 01SRT を VTT、ASS、TTML に変換
  2. 02文字起こしを標準的な字幕ファイルに変換
  3. 03スタイル付きまたは二言語の ASS 字幕を作成
  4. 04単語単位のタイミング情報を含む JSON からカラオケ字幕を生成

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/lattifai/omni-captions-skills --skill omnicaptions-convert

インストール後、Claude Code で/omnicaptions-convertを入力して読み込まれたか確認します。

詳細

キャプション形式の変換

lattifai-captions を使用して、30 種類以上のキャプション形式を相互に変換します。

⚡ YouTube ワークフロー

# 1. Transcribe YouTube video directly
omnicaptions transcribe "https://youtube.com/watch?v=VIDEO_ID" -o transcript.md

# 2. Convert to any format
omnicaptions convert transcript.md -o output.srt
omnicaptions convert transcript.md -o output.ass
omnicaptions convert transcript.md -o output.vtt

使用する場面

  • SRT を VTT、ASS、TTML などに変換する場合
  • Gemini の Markdown 字幕起こしを標準的なキャプション形式に変換する場合
  • 単語レベルのタイムスタンプを含む YouTube VTT をほかの形式に変換する場合
  • 形式を一括変換する場合

使用しない場面

  • 文字起こしが必要な場合(/omnicaptions:transcribe を使用)
  • 翻訳が必要な場合(/omnicaptions:translate を使用)

セットアップ

pip install omni-captions-skills --extra-index-url https://lattifai.github.io/pypi/simple/

クイックリファレンス

形式拡張子読み込み書き込み
SRT.srt✓✓
VTT.vtt✓✓
ASS/SSA.ass✓✓
TTML.ttml✓✓
Gemini MD.md✓✓
JSON.json✓✓
TXT.txt✓✓

全形式:SRT、VTT、ASS、SSA、TTML、DFXP、SBV、SUB、LRC、JSON、TXT、TSV、Audacity、Audition、FCPXML、EDL など。

CLI の使い方

# Convert (auto-output to same directory, only changes extension)
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

# Specify format explicitly
omnicaptions convert input.txt -o out.srt -f txt -t srt

ASS スタイルプリセット

ASS 形式に変換するときは、--style を使用してプリセットスタイルを適用します。

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
プリセット位置1 行目2 行目用途
default下部白白標準的なキャプション
top上部白白下部が隠れている場合
bilingual下部白黄色バイリンガルキャプション(原文 + 译文)
yellow下部黄色黄色視認性を高める場合
バイリンガルの例

SRT に次のような 2 行のキャプションがある場合:

1
00:00:01,000 --> 00:00:03,000
Hello World
你好世界

--style bilingual またはカスタムカラーを使用します:

# Preset: white + yellow
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"

# Mix preset with custom line2 color
omnicaptions convert bilingual.srt -o output.ass --style default --line2-color "#FF6600"
カスタムカラーオプション
オプション説明
--line1-color "#RRGGBB"1 行目(原文)の色
--line2-color "#RRGGBB"2 行目(翻訳)の色

一般的な色:#FFFFFF(白)、#FFFF00(黄色)、#00FF00(緑)、#00FFFF(シアン)、#FF6600(オレンジ)

フォントサイズと解像度

フォントサイズは動画の解像度に基づいて自動計算されます。解像度は次の優先順位で検出されます。

  1. --resolution 引数(例:1080p、4k、1920x1080)
  2. --video 引数(ffprobe を使用して検出)
  3. .meta.json ファイル(omnicaptions download によって保存)
  4. デフォルト:1080p
# Auto-detect from .meta.json (saved by download command)
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

# Detect from video file (uses ffprobe)
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
解像度PlayRes自動フォントサイズ
480p854×48024
720p1280×72032
1080p1920×108048(デフォルト)
2K2560×144064
4K3840×216096

カラオケモード

単語単位のハイライト付きカラオケ字幕を生成します。単語レベルのタイミングが必要です(まず LaiCut でアラインメントを行ってください)。

# Basic karaoke (sweep effect - gradual fill)
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

# LRC karaoke (enhanced word timestamps)
omnicaptions convert lyrics_LaiCut.json -o lyrics_LaiCut_karaoke.lrc --karaoke
効果ASS タグ説明
sweep\kf左から右へ徐々に塗りつぶします(デフォルト)
instant\k単語を即座にハイライトします
outline\ko輪郭を塗りつぶしてから、テキストを塗りつぶします
カラオケのワークフロー
# 1. Align with LaiCut (get word-level timing in JSON)
omnicaptions LaiCut audio.mp3 lyrics.txt

# 2. Convert to karaoke ASS
omnicaptions convert lyrics_LaiCut.json -o karaoke.ass --karaoke

# Or combine with style
omnicaptions convert lyrics_LaiCut.json -o karaoke.ass --karaoke --style yellow

Python の使い方

from omnicaptions import Caption

# Load any format
cap = Caption.read("input.srt")

# Write to any format
cap.write("output.vtt")
cap.write("output.ass")
cap.write("output.ttml")

よくある間違い

間違い解決方法
形式が検出されない--from / --to フラグを使用します
タイムスタンプがないソース形式にタイミング情報が必要です
エンコーディングエラーencoding="utf-8" を指定します

関連スキル

スキル使用する場面
/omnicaptions:transcribe音声/動画から文字起こしが必要な場合
/omnicaptions:translateGemini API で翻訳する場合
/omnicaptions:translateClaude で翻訳する場合(API キー不要)
/omnicaptions:download先に動画/キャプションをダウンロードする場合
ワークフローの例
# Transcribe → Convert → Translate (with Claude)
/omnicaptions:transcribe video.mp4
/omnicaptions:convert video_GeminiUnd.md -o video.srt
/omnicaptions:translate video.srt -l zh --bilingual

コメント