cli-anything-videocaptioner
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesecli-anything-videocaptioner
cli-anything-videocaptioner
AI-powered video captioning tool. Transcribe speech → optimize subtitles → translate → burn into video with beautiful styles.
基于AI的视频字幕生成工具。支持语音转写→字幕优化→翻译→以美观样式嵌入视频全流程。
Installation
安装
bash
pip install cli-anything-videocaptionerPrerequisites:
- Python 3.10-3.12 (1.4.1 requires
videocaptioner; prefer 3.12)>=3.10,<3.13 - must be installed (
videocaptioner)pip install videocaptioner - FFmpeg required for video synthesis
bash
pip install cli-anything-videocaptioner前置要求:
- Python 3.10-3.12(1.4.1要求版本
videocaptioner;推荐使用3.12)>=3.10,<3.13 - 必须安装(执行
videocaptioner)pip install videocaptioner - 视频合成需要FFmpeg
Usage
使用方法
Basic Commands
基础命令
bash
undefinedbash
undefinedShow help
查看帮助
cli-anything-videocaptioner --help
cli-anything-videocaptioner --help
Start interactive REPL mode
启动交互式REPL模式
cli-anything-videocaptioner
cli-anything-videocaptioner
Transcribe a video (free, no setup)
转写视频字幕(免费,无需配置)
cli-anything-videocaptioner transcribe video.mp4 --asr bijian
cli-anything-videocaptioner transcribe video.mp4 --asr bijian
Translate subtitles (free Bing translator)
翻译字幕(免费Bing翻译)
cli-anything-videocaptioner subtitle input.srt --translator bing --target-language en
cli-anything-videocaptioner subtitle input.srt --translator bing --target-language en
Full pipeline: transcribe → translate → burn subtitles
完整流程:转写→翻译→嵌入字幕
cli-anything-videocaptioner process video.mp4 --asr bijian --translator bing --target-language en --subtitle-mode hard
cli-anything-videocaptioner process video.mp4 --asr bijian --translator bing --target-language en --subtitle-mode hard
Review subtitle/script consistency before a final hard-burn
在最终硬嵌入前检查字幕/脚本一致性
cli-anything-videocaptioner synthesize video.mp4 -s subtitles.srt
--subtitle-mode hard
--review-script approved_script.txt
--max-script-diff-ratio 0.12
--subtitle-mode hard
--review-script approved_script.txt
--max-script-diff-ratio 0.12
cli-anything-videocaptioner synthesize video.mp4 -s subtitles.srt
--subtitle-mode hard
--review-script approved_script.txt
--max-script-diff-ratio 0.12
--subtitle-mode hard
--review-script approved_script.txt
--max-script-diff-ratio 0.12
Render a one-frame subtitle preview for review
渲染单帧字幕预览用于审核
cli-anything-videocaptioner review subtitles.srt
--script approved_script.txt
--preview-video video.mp4
--preview-at 00:00:05.000
--preview-output review_5s.png
--script approved_script.txt
--preview-video video.mp4
--preview-at 00:00:05.000
--preview-output review_5s.png
cli-anything-videocaptioner review subtitles.srt
--script approved_script.txt
--preview-video video.mp4
--preview-at 00:00:05.000
--preview-output review_5s.png
--script approved_script.txt
--preview-video video.mp4
--preview-at 00:00:05.000
--preview-output review_5s.png
JSON output (for agent consumption)
JSON输出(供Agent调用)
cli-anything-videocaptioner --json transcribe video.mp4 --asr bijian
undefinedcli-anything-videocaptioner --json transcribe video.mp4 --asr bijian
undefinedREPL Mode
REPL模式
When invoked without a subcommand, the CLI enters an interactive REPL session:
bash
cli-anything-videocaptioner当不指定子命令调用时,CLI会进入交互式REPL会话:
bash
cli-anything-videocaptionerEnter commands interactively with tab-completion and history
可通过交互式方式输入命令,支持自动补全和历史记录
undefinedundefinedCommand Groups
命令组
transcribe — Speech to subtitles
transcribe — 语音转字幕
transcribe <input> [--asr bijian|jianying|whisper-api|whisper-cpp] [--language CODE] [--format srt|ass|txt|json] [-o PATH]- (default): Free, Chinese & English, no setup
bijian - : All languages, requires
whisper-api--whisper-api-key
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 — Optimize and translate
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]- Three steps: Split → Optimize → Translate
- Bing/Google translators are free
- 38 target languages supported (BCP 47 codes)
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]- 包含三个步骤:拆分→优化→翻译
- Bing/Google翻译器免费使用
- 支持38种目标语言(采用BCP 47编码)
synthesize — Burn subtitles into video
synthesize — 字幕嵌入视频
synthesize <video> -s <subtitle> [--subtitle-mode soft|hard] [--quality ultra|high|medium|low] [-o PATH] [--review-script PATH] [--max-script-diff-ratio FLOAT]- Mirrors the stable backend synthesize surface
- checks subtitle/script drift before the final export
--review-script - Prefer reviewed subtitle assets over synthesize-time style tweaking
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 - 建议在合成前先使用已审核的字幕资源,而非在合成阶段调整样式
process — Full pipeline
process — 完整流程
process <input> [--asr ...] [--translator ...] [--target-language ...] [--subtitle-mode ...] [--style ...] [--no-optimize] [--no-translate] [--no-synthesize] [-o PATH]process <input> [--asr ...] [--translator ...] [--target-language ...] [--subtitle-mode ...] [--style ...] [--no-optimize] [--no-translate] [--no-synthesize] [-o PATH]review — Consistency check and preview
review — 一致性检查与预览
review <input.srt|input.ass> [--script PATH] [--max-diff-ratio FLOAT] [--preview-video PATH] [--preview-at TC] [--preview-output PATH]- Detects subtitle/script drift before a hard-burn
- Can render a single review frame instead of producing a full final video
review <input.srt|input.ass> [--script PATH] [--max-diff-ratio FLOAT] [--preview-video PATH] [--preview-at TC] [--preview-output PATH]- 在硬嵌入字幕前检测字幕与脚本的差异
- 可渲染单帧预览图,无需生成完整的最终视频
styles — List style presets
styles — 列出样式预设
stylesstylesconfig — Manage settings
config — 管理设置
config show
config set <key> <value>config show
config set <key> <value>download — Download online video
download — 下载在线视频
download <URL> [-o DIR]download <URL> [-o DIR]JSON Output
JSON输出
All commands support for machine-readable output:
--jsonbash
cli-anything-videocaptioner --json transcribe video.mp4 --asr bijian所有命令均支持参数以生成机器可读的输出:
--jsonbash
cli-anything-videocaptioner --json transcribe video.mp4 --asr bijian{"output_path": "/path/to/output.srt"}
{"output_path": "/path/to/output.srt"}
undefinedundefinedStyle Presets
样式预设
Style support depends on the installed backend version. Use to see what
the backend actually exposes before relying on style-specific workflows.
styles| Name | Mode | Description |
|---|---|---|
| ASS | White text, black outline — clean and universal |
| ASS | Warm white, orange outline — anime/cartoon style |
| ASS | High bottom margin — for portrait/vertical videos |
| Rounded | Dark text on semi-transparent rounded background |
Compatibility flags such as , , , ,
and are backend-version dependent. Do not assume the stable harness
will forward them reliably during ; prefer checked subtitle assets
plus before final export.
layoutrender_modestylestyle_overridefont_filesynthesizereview样式支持情况取决于已安装的后端版本。在依赖特定样式的工作流前,请使用命令查看后端实际提供的样式。
styles| 名称 | 模式 | 描述 |
|---|---|---|
| ASS | 白色文字,黑色描边——简洁通用 |
| ASS | 暖白色文字,橙色描边——动漫/卡通风格 |
| ASS | 底部边距较大——适用于竖屏/垂直视频 |
| Rounded | 深色文字搭配半透明圆角背景 |
兼容性参数如、、、和依赖后端版本。请勿假设稳定的工具包会在过程中可靠地传递这些参数;建议在最终导出前使用已审核的字幕资源并执行检查。
layoutrender_modestylestyle_overridefont_filesynthesizereviewTarget Languages
目标语言
BCP 47 codes: and 23 more.
zh-Hanszh-HantenjakofrdeesruptitarthviidBCP 47编码: 及其他23种语言。
zh-Hanszh-Hantenjakofrdeesruptitarthviid