ffmpeg sepia effect on video

落爺英雄遲暮 提交于 2019-12-24 03:53:18

问题


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!



来源:https://stackoverflow.com/questions/30972646/ffmpeg-sepia-effect-on-video

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!