In Photoshop, you can layer images and choose from dozens of blend modes — multiply, screen, overlay, difference, and more. These modes determine how pixels from one layer combine with pixels from the layers below, enabling everything from subtle colour corrections to dramatic visual effects.
FFmpeg's blend filter brings this same power to video. It takes two video streams and blends them together using one of 30+ blend modes, with component-level control, dynamic expressions, and GPU acceleration via Vulkan.
Whether you're creating glitch art, cinematic overlays, colour grading effects, or motion graphics, blend is one of FFmpeg's most versatile creative tools.
Key takeaways
blendcombines two video streams using 30+ blend modes.- Modes include multiply, screen, overlay, difference, addition, exclusion, and many more.
- Component‑level control — blend R, G, B, and A channels independently.
- Expressions allow dynamic blending (checkerboards, glitch, displacement).
- Vulkan acceleration available with
blend_vulkanfor faster processing. - Works with any pixel format — no format restrictions like
xstack.
The Gap: Photoshop-Style Blending for Video
FFmpeg users have long used the overlay filter to composite videos — placing one video on top of another with optional transparency. But overlay doesn't blend pixel values; it just layers them. If you want to combine pixels — multiply them, add them, or apply a photoshop‑style blend — overlay won't help.
That's where blend comes in. It offers the full spectrum of Photoshop blend modes, but unlike Photoshop, it works frame by frame on video.
(Multiply, Screen, Overlay, Difference, Addition, Exclusion, etc.)
The Symptom: "I Just Want to Mix These Videos Like Photoshop Layers"
You've got two videos. You want to overlay them with a blend mode — maybe screen for a light effect, or multiply for a dark cinematic look, or difference for a glitch effect. You know how to do this in Photoshop, but FFmpeg seems to only have overlay.
That's the gap blend fills.
Core Concepts: What Is the Blend Filter?
The blend filter "blends two video frames" using a specified blend mode. It takes two input streams and produces one output stream.
Key characteristics:
- 30+ blend modes — from standard Photoshop modes to unique FFmpeg modes.
- Component‑level control — you can blend R, G, B, and A channels separately.
- Expressions — use mathematical expressions for dynamic, custom blending.
- Vulkan acceleration —
blend_vulkanfor GPU‑accelerated processing. - Any pixel format — works with all formats, unlike
xstack.
The filter has been part of FFmpeg for years and is well‑tested in production.
Blend Filter Syntax & Parameters
The basic syntax for blend is:
[input0][input1]blend=all_mode=MODE[out]
Parameters:
| Parameter | Description | Default |
|---|---|---|
all_mode | Blend mode for all components | None (required) |
all_expr | Expression for all components | None |
c0_mode / c1_mode / c2_mode / c3_mode | Blend mode for each component (R, G, B, A) | None |
c0_expr / c1_expr / c2_expr / c3_expr | Expression for each component | None |
repeat | Repeat blending (experimental) | 0 |
shortest | Stop when the shortest input ends | 0 |
Important: You must specify either a mode or an expression, but not both for the same component.
As the FFmpeg source notes: "Both parameters can be set to 'all' to apply the same mode or expression to all components".
All 30+ Blend Modes
Here are the available blend modes, grouped by category:
Lighten
Logic
Math
Creative
Darken
Darken
Contrast
Math
Lighten
Contrast
Creative
Lighten
Contrast
Creative
Creative
Lighten
Math
Darken
Contrast
Math
Logic
Contrast
Creative
Contrast
Lighten
Lighten
Contrast
Math
Contrast
Logic
Most commonly used modes:
multiply— Darkens; used for shadows and cinematic grading.screen— Brightens; used for lens flares and overlays.overlay— Combines multiply and screen for high contrast.difference— Inverts colours; used for glitch effects and alignment.addition— Adds pixel values; used for exposure blending.exclusion— Similar to difference but less intense.softlight— Gentle contrast; used for subtle colour grading.
Practical Examples: From Basic to Creative
Example 1: Multiply Blend – Cinematic Darkening
Using multiply to darken a video with a colour overlay.
# Multiply blend — darken a video with a colour overlay ffmpeg -i video.mp4 -f lavfi -i color=0.1:0.05:0.2:1.0:1920x1080 \ -filter_complex "[0:v][1:v]blend=all_mode=multiply[out]" \ -map "[out]" -c:v libx264 -crf 18 output.mp4
Explanation:
-f lavfi -i color=...— generates a solid colour video.blend=all_mode=multiply— blends the video and colour using multiply.
Example 2: Screen Blend – Lens Flare / Light Overlay
Using screen to add a light overlay (or lens flare effect).
# Screen blend — add a lens flare overlay ffmpeg -i video.mp4 -i lensflare.mp4 \ -filter_complex "[0:v][1:v]blend=all_mode=screen[out]" \ -map "[out]" -c:v libx264 -crf 18 output.mp4
Explanation:
screenmode brightens the video where the overlay is bright.- Perfect for adding lens flares, light leaks, or sparkles.
Example 3: Difference Blend – Glitch Effect
Using difference to create a glitch or invert effect.
# Difference blend — glitch effect ffmpeg -i video.mp4 -i video.mp4 \ -filter_complex "[0:v][1:v]blend=all_mode=difference[out]" \ -map "[out]" -c:v libx264 -crf 18 output.mp4
Explanation:
differenceblends a video with itself (or a shifted version) to create glitch effects.- Add a delay or offset for datamosh‑style glitch art.
Example 4: Component-Level Blending
Blend R, G, and B channels separately for creative colour effects.
# Channel‑specific blending — red channel multiply, green channel screen, blue channel normal ffmpeg -i video.mp4 -i overlay.mp4 \ -filter_complex "[0:v][1:v]blend=c0_mode=multiply:c1_mode=screen:c2_mode=normal[out]" \ -map "[out]" -c:v libx264 -crf 18 output.mp4
This creates a unique colour effect by applying different blend modes to each channel.
Advanced: Dynamic Blending with Expressions
The blend filter supports expressions for dynamic, custom blending. You can use variables like X (column), Y (row), W (width), H (height), and T (time in seconds).
Example: Checkerboard Pattern
# Checkerboard blend pattern ffmpeg -i video1.mp4 -i video2.mp4 \ -filter_complex "[0:v][1:v]blend=all_expr='if(eq(mod(X,100),50),A,B)'[out]" \ -map "[out]" -c:v libx264 output.mp4
This creates a checkerboard pattern using pixels from the two videos.
Example: Animated Glitch (Time‑Based)
# Time‑based glitch (drops to difference every 2 seconds) ffmpeg -i video.mp4 -i video.mp4 \ -filter_complex "[0:v][1:v]blend=all_expr='if(eq(mod(T,4),2),A-B,A+B)'[out]" \ -map "[out]" -c:v libx264 -crf 18 output.mp4
This switches between normal blending and difference blending every 2 seconds.
Example: Chroma Key with Difference
# Chroma key with difference blending ffmpeg -i video.mp4 -i green_screen.mp4 \ -filter_complex "[1:v]format=rgba,colorchannelmixer=aa=0.5[fg];[0:v][fg]blend=all_expr='if(gte(A,0.5),A,B)'[out]" \ -map "[out]" -c:v libx264 output.mp4
This uses the difference between frames for chroma key‑style removal.
blend vs. overlay – Which to Use?
✅ blend
- Blends pixel values — multiply, screen, overlay, etc.
- 30+ modes — Photoshop‑style compositing
- Component‑level control — R, G, B, A
- Expressions — dynamic, custom blending
- Vulkan acceleration — fast GPU processing
✅ overlay
- Simple compositing — place one video on top of another
- Transparency — uses alpha channel
- Positioning — x, y coordinates
- Well‑known — many examples online
- Better for watermarks — logos, text overlays
Recommendation: Use blend for creative effects, color grading, and pixel‑level compositing. Use overlay for simple compositing with transparency.
Troubleshooting Common Issues
| Issue | Likely Cause | Fix |
|---|---|---|
| "No blend mode specified" | Missing all_mode or component mode |
Specify at least one mode (e.g., all_mode=multiply) |
| Incorrect colours | Inputs have different pixel formats or colour spaces | Use format=yuv420p or format=rgba on both inputs |
| No effect | Modes like normal produce no visible blending |
Choose a visible mode like multiply, screen, or difference |
| Expression errors | Invalid expression syntax | Test expressions with ffmpeg -f lavfi -i nullsrc -vf "..." |
| Performance issues | Large resolution or complex expressions | Use blend_vulkan for GPU acceleration |
Frequently Asked Questions (FAQ)
What is the blend filter in FFmpeg?
The blend filter is one of FFmpeg's most versatile compositing tools. It takes two video inputs and blends them together using one of 30+ blend modes — just like Photoshop layers but for video. This includes modes like multiply, screen, overlay, difference, and many more.
How do I use the blend filter in FFmpeg?
Basic syntax: ffmpeg -i input1.mp4 -i input2.mp4 -filter_complex '[0:v][1:v]blend=all_mode=screen[out]' -map '[out]' output.mp4. This applies the screen blend mode to combine the two videos. You can also blend individual components (R, G, B, A) separately.
What are the most useful blend modes in FFmpeg?
Screen — brightens and blends; Multiply — darkens and creates shadows; Overlay — combines multiply and screen for contrast; Difference — creates glitch/invert effects; Addition — brightens and increases exposure; Exclusion — creates unique color effects.
Can I use expressions with the blend filter?
Yes. The blend filter supports expressions for dynamic blending. For example, blend=all_expr='if(eq(mod(X,50),0),A,B)' creates a checkerboard pattern. This opens up endless possibilities for animated and dynamic effects.
What's the difference between blend and overlay?
overlay places one video on top of another with optional transparency — it's simpler and doesn't blend pixel values. blend combines pixel values using a blend mode — multiply, screen, difference, etc. Use overlay for watermarks and compositing; use blend for creative effects and color mixing.
Does FFmpeg support GPU‑accelerated blending?
Yes. FFmpeg provides blend_vulkan for GPU‑accelerated blending with Vulkan. This can significantly speed up processing, especially for high‑resolution video and complex blend operations.
Final Word
The blend filter is one of FFmpeg's most powerful creative tools. With 30+ blend modes, component‑level control, and dynamic expressions, it brings Photoshop‑style compositing to video — frame by frame.
Whether you're creating cinematic colour grades, glitch art, lens flares, or complex motion graphics, blend gives you the control you need.
Key takeaways for your workflow:
- Use
multiplyfor dark, cinematic looks - Use
screenfor light effects and overlays - Use
differencefor glitch and invert effects - Use component‑level blending for creative colour effects
- Use expressions for dynamic, time‑based blending
Next time you need to blend two videos, reach for blend. Your creative options are limitless.