> ## Content Index
> Fetch the complete content index at: https://ffmpeguru.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Crossfade between two video clips
- URL: https://ffmpeguru.com/crossfade-between-two-video-clips/
- Published: 2026-09-17T09:00:00.000Z
- Updated: 2026-10-13T17:59:45.000Z
- Author: FFmpeguru
- Tags: ffmpeg

The \`xfade\` filter is a one-line dissolve between two videos. It blends the two streams for a specified duration at a specified offset, so a transition can be programmed in the filter graph without an external editor. The filter supports several transition types: fade, wipe, slide, and more.

## The command

```
ffmpeg -i a.mp4 -i b.mp4 -filter_complex "[0:v][1:v]xfade=transition=fade:duration=1:offset=10,format=yuv420p[v]" -map "[v]" -c:v libx264 -crf 20 out.mp4
```

## What it does

The filter takes the two video streams, applies the transition for \`duration\` seconds starting at \`offset\` seconds into the first stream. The default transition is a dissolve; pass \`transition=wipeleft\` or \`transition=slidedown\` for a directional effect. The output is a single video stream with the transition baked in. For a fade-in or fade-out, use the \`fade\` filter on a single input.

## Requirements

Two video inputs of the same resolution and framerate. The filter is in libavfilter. CPU-only, single-pass. The transition is added during the encode, so the encoder spends extra bits on the blended frames — set your CRF one or two points higher than usual to keep the file size similar.

## Things to avoid

- Crossfading two videos with different resolutions. The filter expects both inputs to match, so a 1080p source and a 720p source will produce a distorted output. Scale the second to match first.
- Forgetting to map the audio. The \`xfade\` filter operates on video; the audio is a separate stream. Add \`acrossfade\` to crossfade the audio at the same offset.
- Using a very long transition. A 5-second crossfade is a stylistic choice; a 30-second crossfade is a pacing problem.
- Confusing \`xfade\` with the \`fade\` filter. \`fade\` is for a single stream (in or out); \`xfade\` is for a transition between two streams.