cli-anything-videocaptioner

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

cli-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-videocaptioner
Prerequisites:
  • Python 3.10-3.12 (
    videocaptioner
    1.4.1 requires
    >=3.10,<3.13
    ; prefer 3.12)
  • videocaptioner
    must be installed (
    pip install videocaptioner
    )
  • FFmpeg required for video synthesis
bash
pip install cli-anything-videocaptioner
前置要求:
  • Python 3.10-3.12(
    videocaptioner
    1.4.1要求版本
    >=3.10,<3.13
    ;推荐使用3.12)
  • 必须安装
    videocaptioner
    (执行
    pip install videocaptioner
  • 视频合成需要FFmpeg

Usage

使用方法

Basic Commands

基础命令

bash
undefined
bash
undefined

Show 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
cli-anything-videocaptioner synthesize video.mp4 -s subtitles.srt
--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
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

JSON output (for agent consumption)

JSON输出(供Agent调用)

cli-anything-videocaptioner --json transcribe video.mp4 --asr bijian
undefined
cli-anything-videocaptioner --json transcribe video.mp4 --asr bijian
undefined

REPL Mode

REPL模式

When invoked without a subcommand, the CLI enters an interactive REPL session:
bash
cli-anything-videocaptioner
当不指定子命令调用时,CLI会进入交互式REPL会话:
bash
cli-anything-videocaptioner

Enter commands interactively with tab-completion and history

可通过交互式方式输入命令,支持自动补全和历史记录

undefined
undefined

Command Groups

命令组

transcribe — Speech to subtitles

transcribe — 语音转字幕

transcribe <input> [--asr bijian|jianying|whisper-api|whisper-cpp] [--language CODE] [--format srt|ass|txt|json] [-o PATH]
  • bijian
    (default): Free, Chinese & English, no setup
  • whisper-api
    : All languages, requires
    --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
  • --review-script
    checks subtitle/script drift before the final export
  • 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 — 列出样式预设

styles
styles

config — 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
--json
for machine-readable output:
bash
cli-anything-videocaptioner --json transcribe video.mp4 --asr bijian
所有命令均支持
--json
参数以生成机器可读的输出:
bash
cli-anything-videocaptioner --json transcribe video.mp4 --asr bijian

{"output_path": "/path/to/output.srt"}

{"output_path": "/path/to/output.srt"}

undefined
undefined

Style Presets

样式预设

Style support depends on the installed backend version. Use
styles
to see what the backend actually exposes before relying on style-specific workflows.
NameModeDescription
default
ASSWhite text, black outline — clean and universal
anime
ASSWarm white, orange outline — anime/cartoon style
vertical
ASSHigh bottom margin — for portrait/vertical videos
rounded
RoundedDark text on semi-transparent rounded background
Compatibility flags such as
layout
,
render_mode
,
style
,
style_override
, and
font_file
are backend-version dependent. Do not assume the stable harness will forward them reliably during
synthesize
; prefer checked subtitle assets plus
review
before final export.
样式支持情况取决于已安装的后端版本。在依赖特定样式的工作流前,请使用
styles
命令查看后端实际提供的样式。
名称模式描述
default
ASS白色文字,黑色描边——简洁通用
anime
ASS暖白色文字,橙色描边——动漫/卡通风格
vertical
ASS底部边距较大——适用于竖屏/垂直视频
rounded
Rounded深色文字搭配半透明圆角背景
兼容性参数如
layout
render_mode
style
style_override
font_file
依赖后端版本。请勿假设稳定的工具包会在
synthesize
过程中可靠地传递这些参数;建议在最终导出前使用已审核的字幕资源并执行
review
检查。

Target Languages

目标语言

BCP 47 codes:
zh-Hans
zh-Hant
en
ja
ko
fr
de
es
ru
pt
it
ar
th
vi
id
and 23 more.
BCP 47编码:
zh-Hans
zh-Hant
en
ja
ko
fr
de
es
ru
pt
it
ar
th
vi
id
及其他23种语言。