cli-anything-videocaptioner
AI搭載の動画キャプション生成ツール。音声認識 → 字幕の最適化 → 翻訳 → 動画への焼き付け。
インストール
pip install cli-anything-videocaptioner
前提条件:
- Python 3.10-3.12(
videocaptioner1.4.1 は>=3.10,<3.13が必要) videocaptionerのインストール(pip install videocaptioner)- FFmpeg(動画合成に必須)
使い方
基本コマンド
# ヘルプ表示
cli-anything-videocaptioner --help
# 対話型REPLモードを起動
cli-anything-videocaptioner
# 動画から文字起こし(無料、設定不要)
cli-anything-videocaptioner transcribe video.mp4 --asr bijian
# 字幕を翻訳(無料Bing翻訳)
cli-anything-videocaptioner subtitle input.srt --translator bing --target-language en
# 完全パイプライン:文字起こし → 翻訳 → 字幕焼き付け
cli-anything-videocaptioner process video.mp4 --asr bijian --translator bing --target-language en --subtitle-mode hard
# 最終焼き付け前に字幕とスクリプトの整合性を確認
cli-anything-videocaptioner synthesize video.mp4 -s subtitles.srt \
--subtitle-mode hard \
--review-script approved_script.txt
# 確認用に1フレームの字幕プレビューをレンダリング
cli-anything-videocaptioner review subtitles.srt \
--script approved_script.txt \
--preview-video video.mp4 \
--preview-output review_5s.png
# JSON出力(エージェント向け)
cli-anything-videocaptioner --json transcribe video.mp4 --asr bijian
REPLモード
サブコマンドなしで起動すると、対話型REPLセッションが始まります。
cli-anything-videocaptioner
# タブ補完と履歴付きで対話的にコマンド入力
コマンドグループ
transcribe — 音声から字幕へ
transcribe <input> [--asr bijian|jianying|whisper-api|whisper-cpp] [--language CODE] [--format srt|ass|txt|json] [-o PATH]
bijian(デフォルト): 無料、中国語・英語対応、設定不要whisper-api: 全言語対応、--whisper-api-keyが必要
subtitle — 字幕の最適化と翻訳
subtitle <input.srt> [--translator llm|bing|google] [--target-language CODE] [--layout target-above|source-above|target-only|source-only] [--no-optimize] [--no-translate] [-o PATH]
- 3ステップ:分割 → 最適化 → 翻訳
- Bing/Google翻訳は無料
- 38のターゲット言語対応(BCP 47コード)
synthesize — 字幕を動画に焼き付け
synthesize <video> -s <subtitle> [--subtitle-mode soft|hard] [--quality ultra|high|medium|low] [-o PATH] [--review-script PATH] [--max-script-diff-ratio FLOAT]
- 安定バックエンドの合成機能をミラーリング
- 字幕の外観は字幕アセット/バックエンドバージョンに依存(追加フラグは不要)
--review-scriptで最終出力前に字幕・スクリプトのずれをチェック- コピー精度が重要なら
--max-script-diff-ratioを低く設定
process — 完全パイプライン
process <input> [--asr ...] [--translator ...] [--target-language ...] [--subtitle-mode ...] [--layout ...] [--no-optimize] [--no-translate] [--no-synthesize] [-o PATH]
review — 整合性チェックとプレビュー
review <input.srt|input.ass> [--script PATH] [--max-diff-ratio FLOAT] [--preview-video PATH] [--preview-at TC] [--preview-output PATH]
- ハードバーン前に字幕とスクリプトのずれを検出
- 最終動画を生成せずに確認用の1フレームだけレンダリング可能
styles — スタイルプリセット一覧
styles
- インストール済みバックエンドがスタイル設定機能を公開しているか報告
config — 設定管理
config show
config set <key> <value>
download — オンライン動画をダウンロード
download <URL> [-o DIR]
JSON出力
すべてのコマンドで --json フラグが使用可能(機械可読出力):
cli-anything-videocaptioner --json transcribe video.mp4 --asr bijian
# {"output_path": "/path/to/output.srt"}
バックエンドに関する注意
- アップストリームのバックエンドは現在 Python
>=3.10,<3.13が必要。マトリックス実行には Python3.12を推奨。 - 合成時の高度なスタイルフラグはバックエンドバージョンに依存します。
stylesコマンドでインストール済みバックエンドが対応しているか確認してください。 layout、render_mode、style、style_override、font_fileなどの互換性フラグは、stylesとバックエンドで対応が確認されない限り非安定として扱ってください。
ターゲット言語
BCP 47コード: zh-Hans zh-Hant en ja ko fr de es ru pt it ar th vi id および他23言語。