Skip to content
cccskills
FreePublished on GitHub

ffmpeg-auto-assemble

ffmpeg 自动拼接成片:一条命令把 storyboard.json(商品图/视频片段 + 口播稿)渲染成带配音、字幕花字、转场、BGM 自动闪避、响度标准化的 9:16 MP4,纯本地运行。

Use when the user wants to assemble/edit/render a product video, 自动剪辑, 一键成片, 拼接视频, 图片转视频, Ken Burns, add BGM/subtitles/voice-over with ffmpeg, or batch-produce short videos without an editor.

The English summary is being prepared. Showing the original description.

Run score Not tested

See how to install

Files included (6)

  • SKILL.md5.0 KB
  • scripts/assemble.py14.5 KB
  • scripts/make_bgm.py2.8 KB
  • scripts/make_cards.py8.0 KB
  • scripts/make_subs.py5.6 KB
  • scripts/tts_edge.py4.5 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

ffmpeg 自动拼接成片 · Auto-assemble with ffmpeg

storyboard.json → 配音(edge-tts)→ 每镜 Ken Burns / 视频裁切 → xfade 转场 → ASS 字幕花字 → BGM 闪避混音 → 两遍 loudnorm(-14 LUFS)→ out/video.mp4 + .srt。

Part of ecommerce-video-skills · 脚本都在本目录 scripts/:assemble.py(主程序)· tts_edge.py · make_subs.py · make_bgm.py(免版权合成 BGM)· make_cards.py(PIL 商品卡/结尾卡)

输入 Inputs

  • storyboard.json(可由 selling-point-storyboard 生成),素材路径相对于该文件
  • 环境:Python 3.9+,pip install pillow numpy edge-tts,ffmpeg(含 libass),CJK 字体

快速开始 Quick start

pip install pillow numpy edge-tts
python scripts/assemble.py examples/aura-bottle/storyboard.json -o out/aura.mp4       # 仓库自带示例,约 30 秒渲染完
python scripts/assemble.py storyboard.json --tts none -o out/preview.mp4             # 离线预览(无配音,按字数估时)
python scripts/assemble.py storyboard.json --size 1080x1080 -o out/main-1x1.mp4      # 主图视频 1:1
python scripts/assemble.py storyboard.json --bgm music.mp3                           # 用你有版权的音乐

storyboard 字段 Fields

字段说明
顶层 voice / rate / pitchedge-tts 音色、语速(如 +10%)、音调
顶层 bgm"auto"(内置合成,免版权)/ 音乐文件路径 / null
顶层 tag全程左上角贴纸(品牌/型号/「演示」)
image 或 video (+start)素材;视频从 start 秒截取本镜时长
line配音文本;镜头时长 = 配音 + 0.15s 前导 + pad
sub字幕(默认同 line);"" 表示本镜不出字幕;**高亮**、`
title / cta花字 / 行动号召按钮
motionzoom_in zoom_out pan_left pan_right pan_up pan_down punch static
fitauto(比例接近则裁满,否则模糊填充)/ cover / blur
transition进入下一镜的 xfade 名:fade slideleft slideup smoothleft circleopen wipeleft …
min / duration / pad最短时长 / 固定时长 / 句后留白(秒)

步骤 Steps

  1. 检查素材都存在、比例合适(商品图 ≥ 1000px);缺结尾卡就用 make_cards.py 生成: python scripts/make_cards.py --image main.png --name "商品名" --points "卖点一|卖点二|卖点三" -o assets/end-card.png
  2. 先 --tts none 跑一遍看画面节奏,再正式渲染。
  3. 渲染后抽帧检查:ffmpeg -ss 3 -i out/video.mp4 -frames:v 1 check.png
  4. 交给 platform-spec-export 导出各平台版本;用 cover-title-ab 做封面。

流水线细节 How it works

  • Ken Burns:逐帧 scale(eval=frame)+crop,比 zoompan 抖动小;punch = 0.35 秒快速推近(钩子专用)。
  • 转场:每镜多渲染半个转场长度,xfade 居中在镜头分界,配音起点不被转场吃掉。
  • 混音:配音按镜头起点放置;BGM 默认 -20 dB,有人声时再压 10 dB(平滑闪避);先压缩/限幅再两遍 loudnorm 到约 -14 LUFS、TP -1.5 dB。
  • 字幕:用真实配音时长生成 build/timing.json → make_subs.py → libass 烧录,同时导出 .srt。

检查清单 Checklist

  • 成片时长、分辨率、帧率正确(ffprobe out/video.mp4)
  • 抽 3 帧:字幕不压商品、不进底部 UI 区
  • 听一遍:配音清楚、BGM 不抢、开头无爆音
  • BGM 有商用授权(auto 合成音乐可放心用)
  • 素材(图片/视频/字体)有使用授权

常见问题与修复 Failure fixes

问题修复
ffmpeg failed看脚本打印的 stderr 末尾;常见是路径错误或 ffmpeg 缺 libass/libx264
画面边缘糊素材分辨率太低;换 ≥1080px 图片或减小 motion 幅度(改 static)
商品被裁掉该镜设 "fit": "blur"
转场处声音被切不会发生(配音按镜头起点对齐);若自定义了 duration 过短,加长即可
渲染慢预设已用 veryfast 中间文件;最终编码可把 -preset medium 改为 fast
想要 1:1 / 16:9--size 1080x1080 / --size 1920x1080,字幕字号自动按比例

参考与致谢:思路受 MoneyPrinterTurbo(MIT)「脚本→配音→字幕→合成」流水线启发,本实现为独立编写的纯 ffmpeg 版本,未复制其代码。

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

AI 口播配音:用免费的 edge-tts(微软 Edge 在线语音)为带货短视频逐句生成配音,自动去首尾静音、统计每句时长、缓存复用,可选音色/语速/音调,并给出口播稿改写规则。Use when the user needs a voice-over, 配音, 口播, 旁白, TTS, text-to-speech, AI 主播声音, or wants to turn a script into audio for 抖音 / TikTok / 视频号 videos.

The English summary is being prepared. Showing the original description.

xianyu110/ecommerce-video-skills97Updated Oct 5, 2026

封面与标题 A/B:为带货短视频生成多套封面(自动挑选清晰帧或用干净素材图 + 不同标题与版式)和多组标题/文案,导出 3:4 / 9:16 封面文件和对比图,并给出 A/B 测试方法与记录表。Use when the user wants a video cover, 封面, 首图, thumbnail, 标题, 文案, title variants, A/B test covers for 抖音 / 视频号 / 小红书 / TikTok, or wants to improve click-through rate.

The English summary is being prepared. Showing the original description.

xianyu110/ecommerce-video-skills97Updated Oct 5, 2026

3 秒钩子脚本:为电商短视频写前 3 秒开场(台词 + 画面 + 花字),按痛点/反差/结果先行/提问/数字/场景代入等钩子类型一次给出多版,并做合规自检。Use when the user asks for a hook, 开头, 黄金 3 秒, 前三秒, opening line, scroll-stopper, 完播率, or wants to rewrite a weak opening for 抖音 / TikTok Shop / 视频号 / Reels.

The English summary is being prepared. Showing the original description.

xianyu110/ecommerce-video-skills97Updated Oct 5, 2026

主图转视频:把一张或几张商品主图/白底图/场景图,写成可直接喂给图生视频模型的镜头提示词(运镜、主体动作、光线、时长、负面约束),并保证商品不变形。Use when the user has product images and wants a product video, 主图视频, 图生视频, image-to-video, animate a product photo, or 让主图动起来 — with any image-to-video model (Seedance / 可灵 Kling / Veo / Runway / Hailuo / Wan …) or a local Ken Burns fallback.

The English summary is being prepared. Showing the original description.

xianyu110/ecommerce-video-skills97Updated Oct 5, 2026

直播切片:从电商直播录屏中找出高光片段(按时间戳 / 按字幕关键词 / 按停顿自动提议),批量导出 9:16 竖屏切片,自动模糊填充横屏画面、烧录标题与字幕、响度标准化,并给切片写标题与开头钩子。Use when the user has a livestream recording and wants 直播切片, 切片, highlights, clips, 高光片段, repurpose a live stream into short videos for 抖音 / 视频号 / TikTok.

The English summary is being prepared. Showing the original description.

xianyu110/ecommerce-video-skills97Updated Oct 5, 2026

多模型镜头提示词适配:把一份分镜表改写成适合不同视频生成模型的提示词(中/英、首帧/首尾帧/纯文生视频、运镜词表、负面约束),模型中立、不编造价格或参数。Use when the user wants the same shot list adapted for Seedance, 可灵 Kling, Veo, Runway, Hailuo/海螺, Wan/通义万相, Sora, Pika or 'any video model', asks 怎么写视频提示词, camera movement terms, or a model returns deformed products.

The English summary is being prepared. Showing the original description.

xianyu110/ecommerce-video-skills97Updated Oct 5, 2026

See all skills by xianyu110

Report a problem with this skill