FFmpeg Sepia Effect Using Colorchannelmixer
This guide explains how to apply a vintage sepia tone effect to any
video using FFmpeg's built-in colorchannelmixer video
filter. By adjusting the mathematical weights of the red, green, and
blue color channels, you can transform modern digital video into a warm,
antique brown monochrome aesthetic without requiring complex color
grading software.
The Sepia Matrix Formula
A sepia tone is achieved by calculating new RGB values based on a weighted combination of the original RGB channels. The industry-standard matrix for a sepia transformation is:
- New Red:
(0.393 * R) + (0.769 * G) + (0.189 * B) - New Green:
(0.349 * R) + (0.686 * G) + (0.168 * B) - New Blue:
(0.272 * R) + (0.534 * G) + (0.131 * B)
Using the
colorchannelmixer Filter
In FFmpeg, the colorchannelmixer filter accepts
parameters corresponding to these matrix weights:
rr,rg,rb: Contribution of input red, green, and blue to the output red channel.gr,gg,gb: Contribution of input red, green, and blue to the output green channel.br,bg,bb: Contribution of input red, green, and blue to the output blue channel.
Basic Command Syntax
Apply the standard sepia formula using the following command:
ffmpeg -i input.mp4 -vf "colorchannelmixer=rr=0.393:rg=0.769:rb=0.189:gr=0.349:gg=0.686:gb=0.168:br=0.272:bg=0.534:bb=0.131" -c:a copy output.mp4Alternatively, you can write the filter using positional parameters:
ffmpeg -i input.mp4 -vf "colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131" -c:a copy output.mp4Command Breakdown
-i input.mp4: Specifies the input video file.-vf "...": Invokes the video filtergraph.colorchannelmixer=...: Sets the individual channel multipliers according to the sepia matrix.-c:a copy: Copies the audio stream directly without re-encoding to save processing time and preserve quality.output.mp4: The resulting output file.
Adjusting Sepia Tone Intensity
You can adjust the strength and warmth of the sepia look by modifying the blue and red output values:
- Stronger/Darker Sepia: Reduce the blue channel
values (
br,bg,bb) slightly lower than standard values (e.g.,br=0.21:bg=0.45:bb=0.10). - Lighter/Subtle Sepia: Blend the sepia values closer
to standard grayscale conversion (
0.299:0.587:0.114across all channels) or increase the blue values to reduce warmth.