Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ffmpeg sepia effect on video

How can I apply simple sepia effect of a video using FFmpeg ? I am seeking for a single line FFmpeg command which I will be using in android.Though I have learnt colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131 on official FFmpeg doc , but unable to apply it properly.Thank you.

like image 819
Gufran Khurshid Avatar asked Oct 16 '25 17:10

Gufran Khurshid


1 Answers

You just need to chain the filters appropriately. But in your approach, using eq filter may be difficult to implement the sepia matrix with FFmpeg as it has an associated matrix. Instead I suggest you an easy way with colorchannelmixer.

ffmpeg -i input_video -filter_complex "
[0:v]colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131[colorchannelmixed];
[colorchannelmixed]eq=1.0:0:1.3:2.4:1.0:1.0:1.0:1.0[color_effect]" -map [color_effect] -c:v libx264 -c:a copy output_video

Here sepia is implemented using colorchannelmixer filter and it is followed by the eq filter to adjust the brightness, contrast, etc. of the video while keeping rgb colour values to their default 1.

Hope this helps you!

like image 189
Chamath Avatar answered Oct 18 '25 10:10

Chamath



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!