mirror of
https://github.com/sun-guannan/CapCutAPI.git
synced 2025-11-25 03:15:00 +08:00
27dce3082d64f2e875dfb98b49d07b813ac3272c
CapCutAPI
Open source CapCut API tool.
Project Features
This project is a Python-based CapCut processing tool that offers the following core functionalities:
Core Features
- 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
Main API Interfaces
/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:
- Copy
config.json.exampletoconfig.json - Modify the configuration items as needed
cp config.json.example config.json
Environment Configuration
Python Environment
This project requires Python version 3.8.20. Please ensure that the correct version of Python is installed on your system.
Install Dependencies
Install the required dependency packages for the project:
pip install -r requirements.txt
Run the Server
After completing the configuration and environment setup, execute the following command to start the server:
python capcut_server.py
Once the server is started, you can access the related functions through the API interfaces.
Usage Examples
Adding a Video
import requests
response = requests.post("http://localhost:9000/add_video", json={
"video_url": "http://example.com/video.mp4",
"start": 0,
"end": 10,
"width": 1080,
"height": 1920
})
print(response.json())
Adding Text
import requests
response = requests.post("http://localhost:9000/add_text", json={
"text": "Hello, World!",
"start": 0,
"end": 3,
"font": "Source Han Sans",
"font_color": "#FF0000",
"font_size": 30.0
})
print(response.json())
Project Features
- 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
Description
Languages
Python
100%