pyJianYingDraft
轻量、灵活、易上手的Python剪映草稿生成及导出工具,构建全自动视频剪辑/混剪流水线!
🧪 本项目的CapCut版本正在开发中,欢迎关注CapCut版本仓库
📢 欢迎加入Discord服务器进行用法或新功能的讨论
使用思路
功能清单
🧪 当前版本
0.3.1新增trange_seconds,并修复剪映10.8的视频蒙版兼容和重复设置视频混合模式的问题。若遇到问题,欢迎提出issue。
视频与图片
| 功能名称 | 5.9 支持状态 | 新版剪映支持状态 |
|---|---|---|
| 本地视频/图片素材与时间控制 | ✅ | 10.8 ✅ |
| 视频整体调节 | ✅ | 10.8 ✅ |
| 视频关键帧 | ✅ | 10.8 ✅ |
| 视频蒙版 | ✅ | 10.8 ✅ |
| 视频色度抠图 | ✅ | 10.8 ✅ |
| 视频背景填充(示例代码) | ✅ | 10.8 ✅ |
| 视频混合模式 | ✅ | 10.8 ✅ |
贴纸
| 功能名称 | 5.9 支持状态 | 新版剪映支持状态 |
|---|---|---|
| 贴纸 | ✅ | 10.8 ✅ |
| 贴纸关键帧 | ✅ | 10.8 ✅ |
音频
| 功能名称 | 5.9 支持状态 | 新版剪映支持状态 |
|---|---|---|
| 本地音频素材与时间控制 | ✅ | 10.8 ✅ |
| 音频淡入淡出与音量 | ✅ | 10.8 ✅ |
| 音频场景音、音色效果 | ✅ | 10.8 ✅ |
| 音频声音成曲效果 | ❌ 不生效 |
10.8 ✅ |
轨道
| 功能名称 | 5.9 支持状态 | 新版剪映支持状态 |
|---|---|---|
| 添加轨道与添加片段 | ✅ | 10.8 ✅ |
| 轨道顺序控制 | ✅ | 10.8 🟡 从其它草稿导入的轨道可能存在顺序问题 |
特效、滤镜和转场
⚠️ 剪映在打开草稿时会尝试自动下载未缓存的动画/特效/转场等,但有可能会超时,表现为“xx加载失败”,这个问题在5.9上出现较多
| 功能名称 | 5.9 支持状态 | 新版剪映支持状态 |
|---|---|---|
| 视频片段动画 | ✅ | 10.8 ✅ |
| 视频片段特效 | ✅ | 10.8 ✅ |
| 视频片段滤镜 | ✅ | 10.8 ✅ |
| 独立轨道特效 | ✅ | 10.8 ✅ |
| 独立轨道滤镜 | ✅ | 10.8 ✅ |
| 转场(示例代码) | ✅ | 10.8 ✅ |
文本及字幕
| 功能名称 | 5.9 支持状态 | 新版剪映支持状态 |
|---|---|---|
| 文本与样式 | ✅ | 10.8 ✅ |
| 字体 | 🟡 未缓存的字体需要二次打开草稿 |
10.8 🟡 未缓存的字体需要二次打开草稿 |
| 文本关键帧 | ✅ | 10.8 ✅ |
| 文本动画 | ✅ | 10.8 ✅ |
| 文字描边、背景和阴影 | ✅ | 10.8 ✅ |
| 文字气泡效果和花字效果(示例代码) | ✅ | 10.8 ✅ |
| 文本自动换行 | ✅ | 10.8 ✅ |
导入 .srt 字幕 |
✅ | 10.8 ✅ |
模板模式
⚠️ 新版剪映中的
draft_content.json往往不是可直接读取的明文 JSON;因此“加载模板”相关能力在新版剪映上通常需要通过DraftFolder(..., fallback_loader=...)接入额外读取器,详情请参见此处
| 功能名称 | 5.9 支持状态 | 新版剪映支持状态 |
|---|---|---|
加载 draft_content.json 文件作为模板 |
✅ | 10.8 🟡 需 fallback_loader |
| 替换音视频片段的素材 | ✅ | 10.8 🟡 依赖模板可读 |
| 修改文本片段的文本内容 | ✅ | 10.8 🟡 依赖模板可读 |
| 将模板草稿中的音视频/文本轨道整体导入到另一草稿中 | ✅ | 10.8 🟡 依赖模板可读 |
| 提取模板中出现的贴纸/气泡/花字等元信息 | ✅ | 10.8 🟡 依赖模板可读 |
批量导出
⚠️ 自动导出依赖旧版剪映可见控件;新版(7及以上)剪映通常不再满足这一前提
| 功能名称 | 5.9 支持状态 | 新版剪映支持状态 |
|---|---|---|
| 控制剪映打开指定草稿 | ✅ | 6.8(剪映6及以下)✅ 10.8(剪映7及以上)❌ |
| 导出草稿至指定位置 | ✅ | 6.8(剪映6及以下)✅ 10.8(剪映7及以上)❌ |
| 调节导出分辨率和帧率 | ✅ | 6.8(剪映6及以下)✅ 10.8(剪映7及以上)❌ |
安装
pyJianYingDraft现已支持pip安装(不含demo),推荐使用开发时测试的Python版本3.8或3.11
pip install pyJianYingDraft
ℹ 关于剪映5.9版本的自动升级问题,可参见相关issue
跨平台兼容性
- Windows:支持包括草稿生成、模板模式和自动导出在内的所有功能(具体可能受到剪映版本限制)
- Linux/MacOS:支持草稿生成和模板模式,但不支持自动导出,且注意生成的草稿仍然需要在Windows版剪映下导出。
Metadata
Release files for pyjianyingdraft 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyjianyingdraft-0.3.1.tar.gz | 325.7 kB | Without provenance | Details for pyjianyingdraft-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyjianyingdraft-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for pyjianyingdraft-0.3.1-py3-none-any.whl |
Total release size: 661.9 kB
Release files / pyjianyingdraft-0.3.1.tar.gz
| Download URL | pyjianyingdraft-0.3.1.tar.gz |
|---|---|
| Size | 325.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9c2299d03f85f5f8fbd9ef92620f3a7f5c10cd2dcbde2da38c6b5e0a98e765d0
|
|
BLAKE2b-256 checksum How to use checksums |
0ced59a64e5a1c88577261bbaa8a98dc5332a8d07ca09561f9947de943c5fe51
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.10
|
Release files / pyjianyingdraft-0.3.1-py3-none-any.whl
| Download URL | pyjianyingdraft-0.3.1-py3-none-any.whl |
|---|---|
| Size | 336.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6ce5efb014caff01b6d1ae433d109d8fb4861924d3ec06b6fc8f9431c89c7ae8
|
|
BLAKE2b-256 checksum How to use checksums |
b74a2ad80da9f30d6bbfac2079b3a89543f63e145c6a1669ff429d9c4ba2b830
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.10
|
Security for pyjianyingdraft 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.