Normalize Clips Before xfade — effect skill for transitions

For AI agents: find the right skill in one call — curl -s "https://varg.ai/how-to/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://varg.ai/how-to/llms.txt. Every page has a markdown twin: add .md to 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.

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):

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

Not for

Install

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