modify readme

This commit is contained in:
sun-guannan
2025-07-12 09:47:42 +08:00
parent f818b9306a
commit 54fd5183c4
2 changed files with 176 additions and 69 deletions

112
README.md
View File

@@ -1,75 +1,71 @@
# CapCutAPI
轻量、灵活、易上手的剪映/CapCutAPI工具,构建全自动化视频剪辑/混剪流水线。
Open source CapCut API tool.
## 项目功能
## Project Features
本项目是一个基于Python的剪映/CapCut处理工具提供以下核心功能
This project is a Python-based CapCut processing tool that offers the following core functionalities:
### 核心功能
### Core Features
- **草稿文件管理**:创建、读取、修改和保存剪映/CapCut草稿文件
- **素材处理**:支持视频、音频、图片、文本、贴纸等多种素材的添加和编辑
- **特效应用**:支持添加转场、滤镜、蒙版、动画等多种特效
- **API服务**提供HTTP API接口支持远程调用和自动化处理
- **AI集成**集成多种AI服务支持智能生成字幕、文本和图像
- **Draft File Management**: Create, read, modify, and save CapCut draft files
- **Material Processing**: Support adding and editing various materials such as videos, audios, images, texts, stickers, etc.
- **Effect Application**: Support adding multiple effects like transitions, filters, masks, animations, etc.
- **API Service**: Provide HTTP API interfaces to support remote calls and automated processing
- **AI Integration**: Integrate multiple AI services to support intelligent generation of subtitles, texts, and images
### 主要API接口
### Main API Interfaces
- `/create_draft`创建草稿
- `/add_video`:添加视频素材到草稿
- `/add_audio`:添加音频素材到草稿
- `/add_image`:添加图片素材到草稿
- `/add_text`:添加文本素材到草稿
- `/add_subtitle`:添加字幕到草稿
- `/add_effect`:添加特效到素材
- `/add_sticker`:添加贴纸到草稿
- `/save_draft`:保存草稿文件
- `/create_draft`: Create a draft
- `/add_video`: Add video material to the draft
- `/add_audio`: Add audio material to the draft
- `/add_image`: Add image material to the draft
- `/add_text`: Add text material to the draft
- `/add_subtitle`: Add subtitles to the draft
- `/add_effect`: Add effects to materials
- `/add_sticker`: Add stickers to the draft
- `/save_draft`: Save the draft file
## 配置说明
## Configuration Instructions
### 配置文件
### Configuration File
项目支持通过配置文件进行自定义设置。要使用配置文件:
The project supports custom settings through a configuration file. To use the configuration file:
1. 复制`config.json.example``config.json`
2. 根据需要修改配置项
1. Copy `config.json.example` to `config.json`
2. Modify the configuration items as needed
```bash
cp config.json.example config.json
```
### 环境配置
### Environment Configuration
#### ffmpeg
#### Python Environment
本项目依赖于ffmpeg您需要确保系统中已安装ffmpeg并且将其添加到系统的环境变量中。
This project requires Python version 3.8.20. Please ensure that the correct version of Python is installed on your system.
#### Python 环境
#### Install Dependencies
本项目需要 Python 3.8.20 版本,请确保您的系统已安装正确版本的 Python。
#### 安装依赖
安装项目所需的依赖包:
Install the required dependency packages for the project:
```bash
pip install -r requirements.txt
```
### 运行服务器
### Run the Server
完成配置和环境设置后,执行以下命令启动服务器:
After completing the configuration and environment setup, execute the following command to start the server:
```bash
python capcut_server.py
```
服务器启动后,您可以通过 API 接口访问相关功能。
Once the server is started, you can access the related functions through the API interfaces.
## 使用示例
## Usage Examples
### 添加视频
### Adding a Video
```python
import requests
@@ -85,16 +81,16 @@ response = requests.post("http://localhost:9000/add_video", json={
print(response.json())
```
### 添加文本
### Adding Text
```python
import requests
response = requests.post("http://localhost:9000/add_text", json={
"text": "你好,世界!",
"text": "Hello, World!",
"start": 0,
"end": 3,
"font": "思源黑体",
"font": "Source Han Sans",
"font_color": "#FF0000",
"font_size": 30.0
})
@@ -102,32 +98,10 @@ response = requests.post("http://localhost:9000/add_text", json={
print(response.json())
```
### 保存草稿
## Project Features
```python
import requests
response = requests.post("http://localhost:9000/save_draft", json={
"draft_id": "123456",
"draft_folder":"your capcut draft folder"
})
print(response.json())
```
### 复制草稿到剪映/capcut草稿路径
调用`save_draft`会在服务器当前目录下生成一个`dfd_`开头的文件夹,将他复制到剪映/CapCut草稿目录即可看到生成的草稿
### 更多示例
请参考项目的`example.py`文件,其中包含了更多的使用示例,如添加音频、添加特效等。
## 项目特点
- **跨平台支持**同时支持剪映和CapCut国际版
- **自动化处理**:支持批量处理和自动化工作流
- **丰富的API**提供全面的API接口方便集成到其他系统
- **灵活的配置**:通过配置文件实现灵活的功能定制
- **AI增强**集成多种AI服务提升视频制作效率
- **Cross-platform Support**: Supports both CapCut China version and CapCut International version
- **Automated Processing**: Supports batch processing and automated workflows
- **Rich APIs**: Provides comprehensive API interfaces for easy integration into other systems
- **Flexible Configuration**: Achieve flexible function customization through configuration files
- **AI Enhancement**: Integrate multiple AI services to improve video production efficiency