Skip to content

Repository files navigation

DabaoAI — Documentary Auto Editing Agent / 纪录片全自动剪辑工具

Turn a long documentary plus SRT subtitles into a Chinese narrated short film with voice cloning, aligned visuals, burned-in subtitles, BGM, covers, and publishing copy.
输入一部纪录片视频和 SRT 字幕,自动生成中文解说成片:文案、配音、画面匹配、字幕、BGM、封面和发布信息一站式完成。

中文 · English

中文说明

项目亮点

DabaoAI 是一个面向纪录片二创、知识视频和短视频工作流的 AI 自动剪辑工具。它不是简单随机抽帧或随意拼接,而是以原片字幕为锚点,让每一句中文口播都尽量对应到原纪录片中的真实画面区间,并通过全局占用表避免素材重复使用。

核心关键词:AI 视频剪辑、纪录片解说、中文口播、自动成片、文案生成、声音克隆、阿里百炼、GPT-SoVITS、Seedream、FFmpeg、FastAPI、React WebUI。

主要功能

  • 一键导入素材文件夹:支持 MP4/MKV 视频和 SRT 字幕。
  • AI 生成中文口播文案:支持先生成、人工修改,再继续成片。
  • 来源锚定剪辑:口播文案和原片字幕/画面尽量精准匹配。
  • 全局去重:同一段原片素材不重复使用。
  • 配音模块:支持阿里百炼默认音色、阿里百炼克隆音色、本地 GPT-SoVITS CPU 模式。
  • 字幕烧录:单行字幕、字体/字号/颜色/描边可调。
  • BGM:支持自动匹配、指定本机音乐或关闭。
  • 封面:使用 Seedream API 生成封面,并支持多比例输出。
  • WebUI:中文控制台,所有主要参数可视化调节。
  • 工作流状态:显示每一步进度、日志和失败步骤重跑入口。

工作流程

flowchart LR
  A["素材文件夹<br/>视频 + SRT"] --> B["解析字幕与视频信息"]
  B --> C["AI 生成中文口播文案"]
  C --> D["用户审核/修改文案"]
  D --> E["TTS 配音/声音克隆"]
  E --> F["来源锚定画面匹配"]
  F --> G["FFmpeg 剪辑与合成"]
  G --> H["字幕/BGM/封面/发布信息"]
  H --> I["最终 MP4 成片"]
Loading

环境要求

  • Windows 10/11 推荐。
  • Python 3.10+。
  • Node.js 18+。
  • FFmpeg 和 FFprobe,并加入系统 PATH。
  • 可选 API Key:
    • DeepSeek:生成文案、发布标题/标签/描述。
    • DashScope / 阿里百炼:默认音色和克隆音色配音。
    • Seedream:封面生成。
    • SiliconFlow:视觉/采访画面过滤等可选能力。

快速安装

git clone https://github.com/<your-github-name>/DabaoAI.git
cd DabaoAI

python -m venv .venv
.\.venv\Scripts\activate
pip install -r requirements.txt

cd frontend
npm install
npm run build
cd ..

copy .env.example .env
notepad .env

.env 中填入你自己的密钥:

DEEPSEEK_API_KEY=
DASHSCOPE_API_KEY=
SILICONFLOW_API_KEY=
SEEDREAM_API_KEY=

启动

双击:

DabaoAI一键启动.bat

或运行:

python launch_dabaoai.py

默认打开:

http://127.0.0.1:7860

使用方法

  1. 准备一个素材文件夹,里面放入原纪录片视频和 SRT 字幕。
  2. 在 WebUI 粘贴素材文件夹地址。
  3. 设置成片时长、片头片尾跳过秒数、配音音色、字幕样式、BGM、封面比例等参数。
  4. 点击“AI 生成文案”,先审核并修改完整口播稿。
  5. 点击“继续一键成片”,系统会自动配音、匹配画面、剪辑、烧录字幕、生成封面和发布文案。
  6. 在素材文件夹或运行输出目录查看最终文件。

常见输出:

★ 成片.mp4
★ 字幕.srt
★ 匹配报告.json
★ 发布信息.txt
★ 发布信息.json
★ 封面_3x4.jpg
★ 封面_9x16.jpg
配音.wav
配音稿.txt

配置与安全

  • .envconfig/secrets.binruntime/、本地素材和生成视频默认不会提交到 Git。
  • config/user_config.example.json 是公开示例配置;真实 config/user_config.json 属于本机配置,不应提交。
  • 请只使用你自己拥有版权或有授权的素材、音乐和音色。

贡献者

  • Dabao

English

What is DabaoAI?

DabaoAI is an AI-powered documentary auto-editing agent. It converts a long documentary and subtitle files into a Chinese narrated video with script generation, voice cloning, visual alignment, subtitles, BGM, covers, and publishing metadata.

Unlike random clip selection, DabaoAI anchors each narration sentence to source subtitle chunks and tries to select matching non-repeated visual segments from the original documentary.

SEO keywords: AI video editor, documentary editing, Chinese narration, voice cloning, automatic video editing, FastAPI, React, FFmpeg, Alibaba Bailian, GPT-SoVITS, Seedream.

Features

  • Folder-based input: video plus SRT subtitles.
  • AI Chinese narration script generation with manual review.
  • Source-anchored visual matching.
  • Non-repeated clip allocation.
  • TTS options: Alibaba Bailian voices, Alibaba Bailian cloned voice, local GPT-SoVITS CPU mode.
  • Burned-in subtitles with adjustable font, size, color, and outline.
  • BGM: auto match, local file, or disabled.
  • Seedream cover generation with multiple aspect ratios.
  • Chinese WebUI with adjustable parameters.
  • Workflow status, live logs, and failed-step rerun controls.

Requirements

  • Windows 10/11 recommended.
  • Python 3.10+.
  • Node.js 18+.
  • FFmpeg and FFprobe in PATH.
  • Optional API keys:
    • DeepSeek for script and publishing copy.
    • DashScope / Alibaba Bailian for TTS and voice cloning.
    • Seedream for cover image generation.
    • SiliconFlow for optional visual analysis.

Quick Start

git clone https://github.com/<your-github-name>/DabaoAI.git
cd DabaoAI

python -m venv .venv
.\.venv\Scripts\activate
pip install -r requirements.txt

cd frontend
npm install
npm run build
cd ..

copy .env.example .env
notepad .env

Then start:

python launch_dabaoai.py

Or double-click:

DabaoAI一键启动.bat

Open:

http://127.0.0.1:7860

How to Use

  1. Put a documentary video and SRT subtitle files in one folder.
  2. Paste the folder path into the WebUI.
  3. Adjust target duration, trim settings, voice, subtitles, BGM, cover ratios, and API settings.
  4. Generate the AI script first.
  5. Review or edit the script.
  6. Continue the one-click workflow to synthesize voice, match visuals, render the video, burn subtitles, create covers, and generate publishing copy.

Privacy and Security

This repository does not include API keys, local user settings, generated videos, runtime caches, or private media files. Use .env.example as a template and keep your real .env private.

Contributor

  • Dabao

About

DabaoAI 纪录片全自动剪辑工具 | AI documentary auto-editing agent with Chinese narration, voice cloning, subtitles, BGM and covers

Topics

Resources

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages