video-loop
Video Loop
Create a seamless looping background video from any source clip. A crossfade blends the last and first frames so the <video loop> transition is invisible, then the pipeline encodes web-optimized MP4 + WebM.
All ffmpeg work happens in scripts/video-loop.sh — this skill validates inputs, optionally helps pick a good fade duration, invokes the script, and turns the script's summary into a human-readable report.
Parameters
| Flag | Default | Description |
|---|---|---|
-d <seconds> |
1.5 |
Crossfade duration in seconds |
-q <crf> |
26 |
H.264 CRF — 18 = high quality, 28 = smaller file |
-w <crf> |
32 |
VP9 WebM CRF |
-o <dir> |
Same as input | Output directory |
-p |
off | Also extract a poster frame (first frame as JPEG) |
-n |
off | No crossfade — optimize and encode only |
No
-s/-Ssave-mode flag. Unlike media-cluster siblings (/audio-loop,/markitdown), video-loop outputs are web assets (MP4 / WebM / poster) the user drops directly into their site's video directory. No downstream skill consumes video files via-f, so the.claude/output/<skill>/<slug>/convention would add ceremony without enabling anything —-o <dir>is the direct path.
Workflow
1. Validate tools
Confirm ffmpeg and ffprobe are available: command -v ffmpeg ffprobe. If either is missing, stop and ask the user to install (macOS: ! brew install ffmpeg, Debian/Ubuntu: ! sudo apt install ffmpeg). Never auto-install.
2. Analyze loop quality (optional but recommended)
Before committing to a crossfade, extract the first and last frames and compare them — this is the one step in the pipeline that genuinely benefits from the model's visual reasoning:
ffmpeg -y -ss 0 -i <input> -frames:v 1 -update 1 /tmp/vl-first.png
ffmpeg -y -sseof -0.1 -i <input> -frames:v 1 -update 1 /tmp/vl-last.png
Read both frames. If they're nearly identical, suggest -n (the source already loops cleanly, crossfade would only blur motion). If they differ significantly, proceed with the default fade or recommend a longer -d for more gradual blending.
3. Run the pipeline
bash ${CLAUDE_SKILL_DIR}/scripts/video-loop.sh <input> [flags]
The script does the rest: probes metadata, builds the lossless loop intermediate when crossfade is requested, encodes MP4 (H.264 + faststart) and WebM (VP9), optionally extracts a poster frame. It emits a machine-readable summary on stdout, one RESULT: key=value line per fact.
4. Report
Parse the RESULT: lines to compose:
- A size table comparing input vs outputs (absolute MB and delta percent)
- A ready-to-paste HTML snippet for the user's site
Report template:
| File | Size | Codec | vs Original |
|------|------|-------|-------------|
| `*-opt.mp4` | X MB | H.264 | -XX% |
| `*.webm` | X MB | VP9 | -XX% |
| `*-poster.jpg` | X KB | JPEG | — |
HTML snippet:
<video autoplay muted loop playsinline preload="metadata" poster="/videos/poster.jpg">
<source src="/videos/name.webm" type="video/webm" />
<source src="/videos/name-opt.mp4" type="video/mp4" />
</video>
WebM first — browsers pick the first supported source.
Why crossfade-first matters
Useful background for debugging "I still see a jump" reports. The script places the xfade at the start of the output, not the end:
[xfade](F seconds): blendsA[end]→A[start]. First frame =A[D-F], last frame =A[F][middle](D−2F seconds): untouched frames fromA[F]toA[D-F]
At the loop boundary, [middle] ends at A[D-F] and the player loops back to [xfade], which starts at the same frame — invisible transition. If the xfade were placed at the end ([middle][xfade]), the xfade would end at A[F] but loop back to A[0] — a visible jump of F seconds.
If the user reports a visible jump despite running the skill, first check whether they pointed at an already-encoded file (re-running re-encodes but doesn't re-loop). If the source is correct, try a longer -d — short fades are more visible on high-motion content.
Rules
- NEVER upscale — the script encodes at source resolution
- NEVER re-encode an already-encoded output (double compression). Always start from the original source
- Audio is always stripped (
-an) — background videos are muted - The script rejects
-d >= duration/2— a too-long fade would leave the middle segment empty - Always report original vs output sizes so the user sees the quality/size tradeoff
More from coroboros/agent-skills
markitdown
Convert any document to Markdown with Microsoft's `markitdown` CLI — PDF, Word, Excel, PowerPoint, HTML, CSV, JSON, XML, ZIP, EPub, images (OCR/EXIF), audio (transcription), and YouTube URLs. Use whenever the user wants to extract text from a binary document, transcribe audio, OCR an image, scrape a YouTube transcript, or pre-process a file for an LLM context window — even when they just say "convert this pdf", "what's in this docx", "transcribe this mp3", or "get the text out of this".
11design-system
Govern the DESIGN.md — Google's open standard for design tokens (YAML frontmatter + eight prose sections). Auto-activates during UI edits to enforce token-only sourcing for colors, typography, spacing, and corner radius. Also exposes six CLI-backed subcommands — audit (lint + fix proposals), diff (regression check), export (Tailwind / DTCG), spec (canonical spec emission), migrate (port from legacy Stitch format), init (minimal scaffold). When a UI/UX change is requested, DESIGN.md is updated first, audited, then code propagates.
3award-design
Build award-winning websites (Awwwards SOTD 7.5+, FWA, CSSDA). Recommends the best design archetype for the brief, calibrates atmosphere, and produces a complete DESIGN.md. Applies anti-AI-slop rules and targets real judging criteria. Use when building landing pages, portfolios, product sites, or any web interface that needs to look exceptional — not for dashboards or internal tools.
3apex
Systematic implementation using APEX methodology (Analyze-Plan-Execute-eXamine) with parallel subagents and self-validation. Use when implementing features, fixing bugs, or making code changes that benefit from structured workflow.
1spec
Transform ideas into structured execution specs with prioritized workstreams, complexity ratings, dependencies, and acceptance criteria. Use this whenever the user needs to decompose work before building — even when they don't explicitly say "spec" (e.g. "break this down", "plan this out", "create issues for", "what are the steps"). The bridge between thinking and building.
1oneshot
Single-pass feature implementation using Explore → Code → Test. Ships focused changes at maximum speed, with a built-in circuit breaker that stops and recommends `/apex` or `/spec` when the task turns out more complex than it looked. Use this whenever the user wants a quick win on a single, focused task — even when they don't say "oneshot" (e.g. "just", "quickly", "small change", "#42", or a GitHub issue URL for a small fix).
1