360 Secure SkillHub
360 安全技能中心

Skill Tiktok Ads Video

核心功能:无需专业剪辑软件,基于Python给短视频叠加TikTok风格动态胶囊字幕,内置多款产品(如加湿器、水瓶)预设,提供4种字幕样式,支持自定义音频、字体及参数调整。典型场景:制作TikTok、Reels、YouTube Shorts等平台的产品广告。输入为基础MP4视频,通过命令行传参,输出带字幕的成品MP4,兼容旧版自定义字幕模式。

zero2ai-hub
zero2ai-hub
热度 84.53
最近更新 2026-05-11 17:27:54
分类:营销依赖:代码执行应用场景:视频编辑 / 社交媒体 / 品牌素材

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add skill-tiktok-ads-video
Metadata
name
skill-tiktok-ads-video
version
2.1.0
description
Generate TikTok-style short-form ad videos with animated pill captions. Takes a base MP4 (Veo/Runway/Kling), overlays animated captions with fade in/out, mixes background audio. Built-in product presets — no captions JSON file needed. Use for TikTok ads, Reels, YouTube Shorts product videos.
metadata
{"openclaw":{"requires":{"bins":["uv"]}}}

skill-tiktok-ads-video v2.0.0

Animated pill-style caption overlays for short-form video. No Premiere, no CapCut — pure Python. v2 ships with built-in product presets — no more manual captions JSON.

Usage (v2 — product presets)

uv run --with moviepy --with pillow scripts/overlay.py \
  --video base.mp4 \
  --output final.mp4 \
  --product rain_cloud \
  --style subtitle_talk

Products

  • rain_cloud — Rain Cloud Humidifier
  • hydro_bottle — Hydrogen Water Bottle
  • mini_cam — Mini Clip Camera

Styles

  • phrase_slam — Bold full-screen phrase drops
  • subtitle_talk — Conversational subtitle-style captions
  • big_center — Large centered text with price bar at top. Best for bold product reveals.
  • random — Randomly picks a style

Optional audio

  --audio music.mp3 \
  --audio-start 8 \
  --audio-vol 0.5

No --audio keeps the original video audio.

Custom fonts

--font-black /path/to/Montserrat-Black.ttf \
--font-bold  /path/to/Montserrat-Bold.ttf

Falls back to Montserrat from ~/.local/share/fonts/ if not specified.

Legacy usage (v1 — manual captions JSON)

Still supported for backward compatibility:

uv run --with moviepy --with pillow scripts/overlay.py \
  --video base.mp4 \
  --output final.mp4 \
  --captions scripts/example_captions.json

PIL textbbox fix

PIL's textbbox((0,0), text, font) returns (x0, y0, x1, y1) where y0 is a non-zero offset (typically 7–15px depending on font size). Drawing text at (x, y) without compensating for this offset causes text to appear below the pill's visual center.

Fix implemented in pill():

bb    = draw.textbbox((0, 0), text, font=font)
x_off, y_off = bb[0], bb[1]
vis_w = bb[2] - bb[0]   # actual visual width
vis_h = bb[3] - bb[1]   # actual visual height

# Compensate offsets when drawing text
tx = cx - vis_w // 2 - x_off
ty = y - y_off
draw.text((tx, ty), text, font=font, fill=fg)

Emoji note

NotoColorEmoji.ttf fails with PIL at arbitrary sizes (bitmap font with limited supported sizes). Use text alternatives ("Free delivery" instead of "Free delivery 🚚") for reliable rendering.