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]
- 安定したバックエンドのsynthesize機能をそのまま利用
- 字幕の外観は、追加のフラグではなく字幕アセット/バックエンドバージョンで制御
--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を推奨します。 - 高度なsynthesize時のスタイルフラグはバックエンドのバージョンに依存します。
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言語。