一键生成抖音标准营销视频:
图片 + 文案 → 视频生成 → 自动发布
核心特性:
cd /home/openclaw/.openclaw/workspace/skills/ddc
python3 scripts/generate.py --images image1.jpg image2.jpg --output video.mp4
python3 scripts/generate.py --config config/custom.json
python3 scripts/generate.py \
--images image1.jpg image2.jpg image3.jpg \
--captions "文案 1" "文案 2" "文案 3" \
--style brand \
--voice male \
--duration 15 \
--output video.mp4
| 参数 | 类型 | 说明 | 示例 |
|---|---|---|---|
| ------ | ------ | ------ | ------ |
--images | list | 图片路径列表 | image1.jpg image2.jpg |
--output | str | 输出文件路径 | video.mp4 |
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| ------ | ------ | -------- | ------ |
--config | str | null | 配置文件路径 |
--captions | list | null | 自定义字幕(逐行) |
--style | str | "brand" | 文案风格 |
--voice | str | "male" | 配音声音 |
--speed | int | 5 | 语速 (4-6) |
--duration | int | 0 | 视频时长 (0=自适应) |
--bgm-volume | float | 0.2 | BGM 音量 (0-1) |
--random-bgm | bool | true | 随机 BGM |
特点:无敏感信息,安全合规,自动生成行业营销用语
电动车行业示例:
安全好骑,续航长久
动力强劲,品质可靠
舒适耐用,性价比高
欢迎到店咨询体验
需要用户提供:
--price 价格--promotion 促销活动--contact 联系方式示例:
python3 scripts/generate.py \
--images image1.jpg image2.jpg \
--style promo \
--price "2399 元" \
--promotion "店庆大促" \
--contact "惠水县爱玛店" \
--captions "72V 六块大电池" "爱玛爱朵惊爆价 2399" "活动截止 4 月 30 日"
男声:
male 或 zh-CN-YunxiNeural - 温暖男声(推荐)zh-CN-YunjianNeural - 沉稳男声女声:
female 或 zh-CN-XiaoxiaoNeural - 温柔女声(推荐)zh-CN-XiaoyiNeural - 活泼女声| speed | 效果 | 适用场景 |
|---|---|---|
| ------- | ------ | --------- |
| 4 | 较慢 | 详细说明 |
| 5 | 正常 | 标准视频(推荐) |
| 6 | 较快 | 快节奏视频 |
特点:
{
"subtitle": {
"enabled": true,
"fontSize": 24,
"fontFamily": "Microsoft YaHei",
"marginV": 50,
"maxLines": 1,
"position": "bottom"
}
}
| 参数 | 值 |
|---|---|
| ------ | ----- |
| 分辨率 | 1080x1920 (9:16 竖屏) |
| 帧率 | 30 fps |
| 编码 | H.264 |
| 格式 | MP4 |
| 时长 | 15-60 秒(自适应) |
根据脚本字数自动计算:
时长 (秒) = 脚本文字数 ÷ 语速 (5.5 字/秒)
根据图片数量自动分配:
每张图片展示时长 = 视频总时长 ÷ 图片数量
示例:
配置:
{
"audio": {
"bgm": {
"enabled": true,
"volume": 0.2,
"random": true
}
}
}
从 Pixabay 下载免费音乐(11 首不同风格):
{
"audio": {
"bgm": {
"from_internet": true
}
}
}
支持的来源:
随机选择的风格:
每次生成都随机选择,不会重复!
自动裁剪或循环以匹配视频时长:
{
"audio": {
"bgm": {
"match_duration": true
}
}
}
效果:
/home/openclaw/.openclaw/workspace-kaifa/quick-test/out/
要求:
--price)--address)电动车行业示例:
{
"video": {
"width": 1080,
"height": 1920,
"fps": 30,
"crf": 20
},
"subtitle": {
"enabled": true,
"fontSize": 24,
"fontFamily": "Microsoft YaHei",
"marginV": 50,
"maxLines": 1
},
"audio": {
"tts": {
"voice": "male",
"speed": 5
},
"bgm": {
"enabled": true,
"volume": 0.2,
"random": true
}
},
"script": {
"autoGenerate": true,
"industry": "电动车"
},
"output": {
"copyToWindows": true,
"windowsPath": "/mnt/f/Desktop/aima/新建文件夹"
}
}
python3 scripts/generate.py \
--images image1.jpg image2.jpg image3.jpg \
--style brand \
--voice male \
--output brand_video.mp4
效果:自动生成安全版营销文案 + 男声配音
python3 scripts/generate.py \
--images image1.jpg image2.jpg \
--captions "惠水县爱玛店庆大促" "72V 爱玛爱朵 2399 元" "截止 4 月 30 日" \
--voice female \
--speed 6 \
--output promo_video.mp4
效果:按提供的文案逐行显示字幕
python3 scripts/generate.py \
--images image1.jpg image2.jpg image3.jpg \
--style promo \
--price "2399 元" \
--promotion "店庆大促" \
--contact "惠水县爱玛店" \
--captions "72V 六块大电池" "爱玛爱朵惊爆价" "活动截止 4 月 30 日" \
--voice male \
--bgm-volume 0.25 \
--output aima_video.mp4
效果:包含用户提供的所有信息
python3 scripts/generate.py --config config/custom.json
config/custom.json:
{
"images": ["/path/to/image1.jpg", "/path/to/image2.jpg"],
"style": "brand",
"voice": "male",
"speed": 5,
"bgm_volume": 0.2,
"output": "video.mp4"
}
1. 读取参数/配置文件
↓
2. 生成/优化文案
├─ 有 captions → 使用提供的文案
├─ style=brand → 生成安全版营销文案
└─ style=promo → 需要用户提供敏感信息
↓
3. 优化脚本字数
└─ 根据目标时长自动增减(不改变原意)
↓
4. 生成 TTS 配音
└─ Edge TTS(男声/女声可选)
↓
5. 生成逐行字幕
└─ SRT 格式,一句一条
↓
6. 选择随机 BGM
└─ 从指定文件夹随机选择
↓
7. 生成视频
├─ 图片处理(1080x1920)
├─ 字幕合成(逐行显示)
├─ 音频混合(TTS + BGM)
└─ 输出 MP4
↓
8. 复制到 Windows(可选)
└─ 自动复制到指定目录
禁止编造:
--price)--promotion)--contact)--address)安全用语:
| 时长 | 图片数 | 渲染时间 |
|---|---|---|
| ------ | -------- | --------- |
| 15 秒 | 8-12 张 | ~30 秒 |
| 20 秒 | 12-15 张 | ~45 秒 |
| 30 秒 | 15-20 张 | ~60 秒 |
| 文件 | 说明 |
|---|---|
| ------ | ------ |
video.mp4 | 最终视频 |
tts.mp3 | 配音音频 |
subtitle.srt | 字幕文件 |
/home/openclaw/.openclaw/workspace/skills/video-auto/output/F:\Desktop\aima\新建文件夹\(自动复制)A: 检查网络连接,Edge TTS 需要访问微软服务
A: 检查 subtitle.enabled: true,确认 SRT 文件存在
A: 调整 --bgm-volume 0.25
A: 使用 --voice male 或 --voice female
A: 使用 --random-bgm false
Last updated: 2026-04-07
共 1 个版本