跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
视频与音频

booth-loop-video

Use this skill whenever the user asks for a looping booth, kiosk, trade-show, lobby-screen, or silent background video — including requests phrased as "a video loop for our stand", "an animated explainer with no voiceover", "a motion graphic for the monitor", or "turn this pitch into a looping MP4". Generate and run a self-contained Python render script (Pillow + ffmpeg) that outputs a 1920x1080 30fps MP4. Do NOT use this skill for videos that need narration, live footage, or editing of an existing video file.

microsoft · 已有静态检查记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add microsoft/cat-agent-skills --skill booth-loop-video

技能说明


name: booth-loop-video description: Use this skill whenever the user asks for a looping booth, kiosk, trade-show, lobby-screen, or silent background video — including requests phrased as "a video loop for our stand", "an animated explainer with no voiceover", "a motion graphic for the monitor", or "turn this pitch into a looping MP4". Generate and run a self-contained Python render script (Pillow + ffmpeg) that outputs a 1920x1080 30fps MP4. Do NOT use this skill for videos that need narration, live footage, or editing of an existing video file.

Booth / kiosk loop video

Produce a silent, looping MP4 (default 1920x1080, 30 fps, 60-135 s) suitable for a conference stand, a lobby screen, a reception kiosk, a LinkedIn post, or an embedded slide in a deck.

The output is a rendered animation, not a slideshow export. Every frame is painted in Python, so layout, timing, and easing are fully under your control.

Execution model — do the work, don't hand out instructions

You have Python and a shell. Never tell the user to open an editor or run the script themselves. You:

  1. Write a single self-contained script at work/booth_video.py.
  2. Install dependencies if missing: pip install pillow imageio imageio-ffmpeg numpy (imageio-ffmpeg ships its own ffmpeg binary — no system install needed).
  3. Render preview PNGs and show them to the user.
  4. Only after previews look right, run the full render.
  5. Report the output path.

All paths are relative to the current working directory:

{CWD}/
  work/
    booth_video.py
    preview/scene_1.png ...
  output/
    booth_loop.mp4

Write intermediate frames to the system temp directory, not the working folder. Rendering thousands of PNGs into a cloud-synced folder (OneDrive, Dropbox, iCloud) will stall the render and thrash the sync client.

Design defaults

Use these unless the user supplies a brand palette. Ask for their colours if the video is customer-facing; don't invent a brand.

Canvas1920x1080, 30 fps
Duration60-135 s
Backgrounddeep navy #0A1628
Accents#0078D4 primary, #B4009E secondary
Cards#112244, 18 px corner radius, ~86% alpha
Typehumanist sans, generous whitespace
Motion0.5 s fade in, 0.3 s fade out per scene, smooth-step easing

Dark, low-saturation background with two saturated accents reads well on a bright show floor and survives poor monitor calibration.

Script architecture

One file. A render_frame(t, total) function that returns a Pillow Image for time t in seconds, and a scene table:

SCENES = [
    (0.0,  8.0,  scene_hook),
    (8.0,  22.0, scene_problem),
    (22.0, 40.0, scene_how_it_works),
    # ...
    (108.0, 120.0, scene_cta),
]

def render_frame(t, total):
    img = Image.new("RGBA", (W, H), BG)
    draw = ImageDraw.Draw(img)
    for start, end, fn in SCENES:
        if start <= t < end:
            fn(draw, img, t - start, end - start)
    return img

Time-relative scene functions (local_t, duration) make it trivial to reorder or retime scenes later without touching their internals.

Animation helpers — always include these

def ease_in_out(t):  return t * t * (3 - 2 * t)
def lerp(a, b, t):   return a + (b - a) * t
def clamp(v, lo, hi): return max(lo, min(hi, v))
def fade(t, start, end): return clamp((t - start) / (end - start + 1e-6), 0.0, 1.0)

Combine them: alpha = ease_in_out(fade(local_t, 0, 0.5)) * (1 - fade(local_t, dur - 0.3, dur)) gives a clean in/out envelope for any element.

Cross-platform font loading

Never hardcode a single font path — it will fail on another machine. Probe a candidate list per weight and fall back gracefully:

import os
from PIL import ImageFont

FONT_DIRS = [
    "C:/Windows/Fonts",                       # Windows
    "/usr/share/fonts/truetype/dejavu",       # Linux
    "/usr/share/fonts/truetype/liberation",   # Linux
    "/System/Library/Fonts/Supplemental",     # macOS
    "/Library/Fonts",                         # macOS
]

CANDIDATES = {
    "light":    ["segoeuil.ttf", "HelveticaNeue.ttc", "DejaVuSans-ExtraLight.ttf", "arial.ttf"],
    "regular":  ["segoeui.ttf", "Helvetica.ttc", "DejaVuSans.ttf", "LiberationSans-Regular.ttf", "arial.ttf"],
    "semibold": ["seguisb.ttf", "DejaVuSans-Bold.ttf", "LiberationSans-Bold.ttf", "arialbd.ttf"],
    "bold":     ["segoeuib.ttf", "DejaVuSans-Bold.ttf", "LiberationSans-Bold.ttf", "arialbd.ttf"],
    "mono":     ["consola.ttf", "Menlo.ttc", "DejaVuSansMono.ttf", "cour.ttf"],
}

def get_font(weight, size):
    for name in CANDIDATES.get(weight, CANDIDATES["regular"]):
        for d in FONT_DIRS:
            p = os.path.join(d, name)
            if os.path.exists(p):
                try:
                    return ImageFont.truetype(p, size)
                except OSError:
                    continue
    return ImageFont.load_default()

Print which font actually resolved on the first call. A silent fall back to load_default() produces a tiny bitmap font and a video that looks broken — you want to know before the full render, not after.

Z-order rule — the one that bites

Pillow paints in call order: later calls sit on top. Draw connectors before the things they connect.

For any hub-and-spoke, node-and-edge, or step-and-arrow layout, split into two passes:

# Pass 1 — background layer: every connector
for item in items:
    draw.line([hub_xy, item.xy], fill=LINE, width=2)

# Pass 2 — foreground layer: every node
draw_hub(draw, hub_xy)
for item in items:
    draw_card(draw, item.xy, item.label)

Interleaving the two passes draws lines across cards and through label text. This is the single most common defect in generated diagrams-in-motion, and it is invisible until you look at a rendered frame — which is why previews are mandatory.

Scene planning

Design for someone walking past at 3 m who gives you eight seconds.

  1. Hook (0-8 s) — one bold h
阅读完整来源 ↗