Cli Anything Videocaptioner

作者 hkuds34f519533bc1无许可证51K 个星标收录于 2026年10月8日更新于 2026年10月8日仓库2周前更新

AI-powered video captioning — transcribe speech, optimize/translate subtitles, and burn them into video via the stable VideoCaptioner backend. Free ASR and translation included.

仅含说明Design & Creative
AI 生成的概览

命令行工具,可将视频语音转写为字幕、优化并翻译字幕,再把字幕压制进视频。

功能
该技能把 VideoCaptioner 后端封装为命令行界面,提供 transcribe、subtitle、synthesize、process、review、styles、config 和 download 等命令。它能把语音转成 SRT/ASS/TXT/JSON 字幕,对字幕文件进行切分、优化和翻译,支持 38 种目标语言,并以软字幕或硬字幕方式渲染进视频。review 命令可检查字幕与脚本的偏差,并可只渲染一帧预览图;所有命令都支持 JSON 输出,便于智能体读取。
适用场景
适合需要端到端为视频加字幕的场景:从音频生成字幕、翻译或整理已有字幕文件,或把字幕压制进视频。也适用于在最终硬字幕导出前,需要核对已批准脚本与字幕一致性的流程。
运行要求
需要 Python 3.10-3.12(建议 3.12)、videocaptioner 包,以及用于视频合成的 FFmpeg,通过 pip 安装。部分语音识别方式(whisper-api)需要 API 密钥;Bing、Google 翻译和 bijian 语音识别被描述为免费。在线视频下载和在线翻译需要网络访问。不附带脚本,仅为说明文档。

cli-anything-videocaptioner

AI-powered video captioning tool. Transcribe speech → optimize subtitles → translate → burn into video.

Installation

bash
pip install cli-anything-videocaptioner

Prerequisites:

  • Python 3.10-3.12 (videocaptioner 1.4.1 requires >=3.10,<3.13)
  • videocaptioner must be installed (pip install videocaptioner)
  • FFmpeg required for video synthesis

Usage

Basic Commands

bash
# Show helpcli-anything-videocaptioner --help
# Start interactive REPL modecli-anything-videocaptioner
# Transcribe a video (free, no setup)cli-anything-videocaptioner transcribe video.mp4 --asr bijian
# Translate subtitles (free Bing translator)cli-anything-videocaptioner subtitle input.srt --translator bing --target-language en
# Full pipeline: transcribe → translate → burn subtitlescli-anything-videocaptioner process video.mp4 --asr bijian --translator bing --target-language en --subtitle-mode hard
# Review subtitle/script consistency before a final hard-burncli-anything-videocaptioner synthesize video.mp4 -s subtitles.srt \  --subtitle-mode hard \  --review-script approved_script.txt
# Render a one-frame subtitle preview for reviewcli-anything-videocaptioner review subtitles.srt \  --script approved_script.txt \  --preview-video video.mp4 \  --preview-output review_5s.png
# JSON output (for agent consumption)cli-anything-videocaptioner --json transcribe video.mp4 --asr bijian

REPL Mode

When invoked without a subcommand, the CLI enters an interactive REPL session:

bash
cli-anything-videocaptioner# Enter commands interactively with tab-completion and history

Command Groups

transcribe — Speech to subtitles

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

subtitle — Optimize and translate

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)

synthesize — Burn subtitles into video

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
  • Subtitle look is controlled by the subtitle asset/backend version, not extra harness flags
  • --review-script checks subtitle/script drift before the final export
  • Lower --max-script-diff-ratio when copy accuracy matters more than resilience

process — Full pipeline

process <input> [--asr ...] [--translator ...] [--target-language ...] [--subtitle-mode ...] [--layout ...] [--no-optimize] [--no-translate] [--no-synthesize] [-o PATH]

review — Consistency check and preview

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

styles — List style presets

styles
  • Reports whether the installed backend exposes preset styling support

config — Manage settings

config showconfig set <key> <value>

download — Download online video

download <URL> [-o DIR]

JSON Output

All commands support --json for machine-readable output:

bash
cli-anything-videocaptioner --json transcribe video.mp4 --asr bijian# {"output_path": "/path/to/output.srt"}

Backend Notes

  • The upstream backend currently requires Python >=3.10,<3.13; prefer Python 3.12 for matrix runs.
  • Advanced synthesize-time style flags are backend-version dependent. Use styles to check whether the installed backend exposes them.
  • Compatibility flags such as layout, render_mode, style, style_override, and font_file should be treated as non-stable unless styles and the installed backend confirm they are supported.

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.

来源与署名

来源:hkuds/cli-anything位于skills/cli-anything-videocaptioner提交34f5195

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架