Communitygithub.com

CLI-Anything 视频字幕机

AI 驱动的视频字幕工具 — 转录语音、优化/翻译字幕,并通过稳定的 VideoCaptioner 后端将字幕嵌入视频。免费 ASR 和翻译。

CLI-Anything 视频字幕机 是什么?

这是一个名为 cli-anything-videocaptioner 的 AI 技能,专注于视频字幕处理。它通过命令行界面提供完整的视频字幕工作流:首先使用免费或可配置的语音识别引擎(如 bijian)将语音转录为字幕,然后对字幕进行智能分句和优化,接着支持通过免费或 LLM 翻译器将字幕翻译为目标语言,最后将生成的字幕以硬编码或软字幕形式合入视频。该技能支持 Python 3.10-3.12 环境,并依赖 FFmpeg 进行视频合成。主要使用场景包括视频内容本地化、自媒体字幕制作、以及需要批量处理视频字幕的自动化流水线。它提供 REPL 交互模式、JSON 输出以适配 AI Agent 消费,以及脚本一致性审查功能。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/HKUDS/CLI-Anything/tree/HEAD/skills/cli-anything-videocaptioner

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

cli-anything-videocaptioner

AI 驱动的视频字幕工具。转录语音 → 优化字幕 → 翻译 → 嵌入视频。

安装

pip install cli-anything-videocaptioner

前置条件:

  • Python 3.10-3.12(videocaptioner 1.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

# 渲染一帧字幕预览以供审查
cli-anything-videocaptioner review subtitles.srt \
  --script approved_script.txt \
  --preview-video video.mp4 \
  --preview-output review_5s.png

# JSON 输出(供 Agent 消费)
cli-anything-videocaptioner --json transcribe video.mp4 --asr bijian

REPL 模式

当未带子命令调用时,CLI 会进入交互式 REPL 会话:

cli-anything-videocaptioner
# 使用 Tab 补全和历史记录交互式输入命令

命令组

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]
  • 三个步骤:分句 → 优化 → 翻译
  • 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]
  • 在硬编码前检测字幕/脚本偏差
  • 可以渲染单个审查帧,而不是生成完整的最终视频

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;对于矩阵运行,推荐 Python 3.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 种。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

cli-anything-adguardhome

>-

cli-anything-anygen

>-

cli-anything-audacity

>-

cli-anything-blender

>-

cli-anything-browser

Browser automation CLI using DOMShell MCP server. Maps Chrome

cli-anything-calibre

>-

cli-anything-ccswitch

CLI interface for CC Switch — manage AI coding tool configurations from the terminal

cli-anything-chromadb

>-

cli-anything-cloudanalyzer

Command-line interface for CloudAnalyzer — Agent-friendly harness for CloudAnalyzer, a QA platform for mapping, localization, and perception outputs. Supports 27 commands across 8 groups: point cloud evaluation, trajectory evaluation, ground segmentation QA, config-driven quality gates, baseline evolution, processing, visualization, and interactive REPL.

cli-anything-cloudcompare

Command-line interface for CloudCompare — Agent-friendly harness for CloudCompare, the open-source 3D point cloud and mesh processing software. Supports 41 commands across 9 groups: project management, session control, point cloud operations (subsample, filter, segment, analyze), mesh operations, distance computation (C2C, C2M), transformations (ICP, matrix), export (LAS/LAZ/PLY/PCD/OBJ/STL/E57), and interactive REPL.

cli-anything-comfyui

>-

cli-anything-dify-workflow

Wrapper for the Dify workflow DSL CLI. Create, inspect, validate, edit, and export Dify workflow files through a CLI-Anything harness.

cli-anything-drawio

>-

cli-anything-eez-studio

Use EEZ Studio from the command line: inspect and modify native .eez-project files, edit LVGL screens/widgets, manage SCPI commands, and invoke the real EEZ Studio backend for LVGL builds.

cli-anything-eth2-quickstart

>-

cli-anything-exa

>-

cli-anything-firefly-iii

Firefly III CLI - Personal finance management via CLI-Anything

cli-anything-freecad

Complete CLI harness for FreeCAD parametric 3D CAD modeler (258 commands). Covers ALL workbenches: Part (29 primitives + boolean + mirror + loft + sweep), Sketcher (26 cmds: geometry + constraints + editing), PartDesign (38 cmds: pad/pocket/groove/fillet/chamfer/patterns/hole/datum), Assembly (11 cmds), Mesh (16 cmds), TechDraw (15 cmds: views + dimensions + PDF/SVG), Draft (33 cmds: 2D shapes + arrays + transforms), FEM (12 cmds), CAM/CNC (10 cmds), Surface (6 cmds), Spreadsheet (7 cmds), Import (13 formats), Export (17 formats), Measure (12 cmds), Materials (21 presets). Headless FreeCAD export to STEP/IGES/STL/OBJ/DXF/PDF/glTF/3MF.

cli-anything-gimp

>-

cli-anything-godot

>-

相关技能