我想在视频上放置一个颜色叠加(蓝色,红色或绿色或十六进制值),为它提供类似Instagram效果的滤镜。
我认为应该是这样的:
ffmpeg -i video.mp4 -i "red.png" -filter_complex "blend=all_mode='screen':all_opacity=0.7" output.mp4或者也许是all_mode=overlay
但是我收到一个错误:
First input link top parameters (SAR 0:1) do not match the corresponding second input link bottom parameters (SAR 1:1).我也试过lutrgb=r=1.5 ,但是没有给它一个红色(它取红色)。
我究竟做错了什么 ?
I want to put a color overlay (blue, red or green or hex value) over a video giving it a Instagram filter like effect.
I think it should be in the lines of:
ffmpeg -i video.mp4 -i "red.png" -filter_complex "blend=all_mode='screen':all_opacity=0.7" output.mp4or maybe with all_mode=overlay
But I get an error:
First input link top parameters (SAR 0:1) do not match the corresponding second input link bottom parameters (SAR 1:1).I also tried with lutrgb=r=1.5, but that didn't give it a red color (it takes the red away).
What am i doing wrong ?
最满意答案
两个输入必须共享相同的尺寸和SAR。 您可以使用setsar过滤器设置相同的SAR,也可以使用color完全避免使用图像文件:
ffmpeg -i video.mp4 -f lavfi -i "color=red:s=1280x720" -filter_complex "blend=shortest=1:all_mode=screen:all_opacity=0.7" output.mp4其中s=1280x720是输入视频帧的大小。
颜色具有[0x|#]RRGGBB[AA]格式。
更新:
如果您仍然遇到输入视频SAR问题,请尝试使用setsar过滤器明确设置它:
ffmpeg -i video.mp4 -f lavfi -i "color=red:s=1280x720" \ -filter_complex "[0:v]setsar=sar=1/1[s];\ [s][1:v]blend=shortest=1:all_mode=screen:all_opacity=0.7[out]" \ -map [out] -map 0:a output.mp4The two inputs must share the same dimensions and SAR. You can either use the setsar filter to set the same SAR or you can avoid using an image file completely by using color:
ffmpeg -i video.mp4 -f lavfi -i "color=red:s=1280x720" -filter_complex "blend=shortest=1:all_mode=overlay:all_opacity=0.7" output.mp4Where s=1280x720 is the size of the input video frame.
The color has the [0x|#]RRGGBB[AA] format.
Update:
If you still have issues with the input video SAR try to explicitly set it using the setsar filter:
ffmpeg -i video.mp4 -f lavfi -i "color=red:s=1280x720" \ -filter_complex "[0:v]setsar=sar=1/1[s];\ [s][1:v]blend=shortest=1:all_mode=overlay:all_opacity=0.7[out]" \ -map [out] -map 0:a output.mp4更多推荐
发布评论