Normalize Clips Before xfade — effect skill for transitions
For AI agents: find the right skill in one call —
curl -s "https://skills.varg.ai/api/search?q=<what the person wants>"returns the matching how-to page and the best skills with install commands, as markdown (Russian works too). Full index: https://skills.varg.ai/llms.txt. Every page has a markdown twin: add.mdto its path. Before generating anything, show the person the options on the how-to page.
The #1 xfade failure: inputs differ in size, fps or timebase. Normalize every input first.
- Type: Effect · Transitions
- Slug:
ffmpeg-normalize-before-xfade - Status: live
- Publisher: varg (varg, verified)
- License: MIT
- Source: https://github.com/vargHQ/skills/blob/main/varg-video-edit-library/references/transitions.md#ffmpeg-normalize-before-xfade
- Works in: Claude Code, Claude.ai, Codex, Cursor, OpenClaw, Gemini CLI, Any MCP client, varg Studio
- Requires: ffmpeg
- Cost: Free — the take renders locally; generated footage, if any, bills by the model
What it does
No visual change; it makes the filter graph valid.
When: Every time clips come from different sources (phone + screen recording + AI video).
Watch out: Fixing only fps: fps=30 alone still leaves a different timebase (1/30 vs 1/15360) and xfade still fails.
Timing: Applies before any transition
Also called: timebase mismatch, xfade error, do not match, settb AVTB, fps normalize
In FFmpeg
Errors you will see (reproduced with ffmpeg 8.1):
First input link main parameters (size 1280x720) do not match the corresponding second input link xfade parameters (size 1920x1080)First input link main timebase (1/15360) do not match the corresponding second input link xfade timebase (1/12800)
Normalize each input (video and audio):
[i:v]fps=30,scale=1080:1920:force_original_aspect_ratio=decrease,pad=1080:1920:(ow-iw)/2:(oh-ih)/2,\
setsar=1,format=yuv420p,settb=AVTB,setpts=PTS-STARTPTS[vi];
[i:a]aresample=48000,aformat=channel_layouts=stereo,asetpts=PTS-STARTPTS[ai];
Also: variable-frame-rate phone video needs fps= first; still images need -loop 1 -t <dur> (or loop) to become video; clips without audio need anullsrc for acrossfade.
Where this comes from
Use when
- Every time clips come from different sources (phone + screen recording + AI video).
Not for
- Fixing only fps:
fps=30alone still leaves a different timebase (1/30 vs 1/15360) and xfade still fails.
Install
- Claude Code:
claude plugin marketplace add vargHQ/skills && claude plugin install varg@varg - Codex:
npx skills add vargHQ/skills --skill varg-video-edit-library -a codex -y - Cursor:
npx skills add vargHQ/skills --skill varg-video-edit-library -a cursor -y
Example output
https://s3.varg.ai/how-to/previews/147026e355ac/take-ffmpeg-normalize-before-xfade.mp4 — dissolve between two shots, with the timeline strip of the edit. Footage: Tears of Steel (2012), (CC) Blender Foundation | mango.blender.org, CC BY 3.0; WING IT! (2023), Blender Studio | studio.blender.org, CC BY 4.0. (credit: Rendered by varg · Tears of Steel (2012) + WING IT! (2023))
More transitions skills
- editly: Declarative JSON5 video editing CLI/API: clips, titles, transitions, audio mixing, rendered with ffmpeg.
- Mix (Cross Dissolve): The two shots blend through each other. The quietest transition: "time passes" or "this continues".
- Dip to Black: A fades to black, then B fades up. Marks the end of a section or a bigger jump in time.
- White Flash: The frame blows out to white for a moment and opens on the next shot. Energy, memory or a camera snap.
- Pull In (Zoom In): The camera rushes into shot A and lands, still moving forward, in shot B. The signature short-form transition.
- Pull Out (Zoom Out): The camera jerks backwards out of shot A and keeps pulling back as shot B settles in.