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.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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!