水印如何缩放和缩放? [英] How to scale and position watermark to scale?
本文介绍了水印如何缩放和缩放?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在缩放视频并应用水印,如下所示:
I'm scaling a video and applying a watermark like so:
ffmpeg -ss 0:0:0.000 -i video.mp4 -y -an -t 0:0:10.000
-vf \"[in]scale=400:316[middle]\" -b:v 2000k -r 20
-vf 'movie=watermark.png,pad=400:316:0:0:0x00000000 [watermark];[middle] [watermark]overlay=0:0[out]'
out.flv
然而,应用的水印似乎被缩放到原始视频大小,而不是较小的缩放视频大小。
However, the applied watermark seems to be scaled to the original video size rather than the smaller scaled video size.
此命令行在ffmpeg版本 0.8.6.git
上工作,现在在升级到版本 N-52381-g2288c77
。
This command line worked on ffmpeg version 0.8.6.git
and now behaves differently after an upgrade to version N-52381-g2288c77
.
如何让它重新工作?
更新2013-04-26:
我现在尝试使用覆盖过滤器的X和Y参数而不是填充而不成功。
Update 2013-04-26:
I now have tried to use the overlay filter's X and Y parameters instead of padding without success.
推荐答案
在FFmpeg IRC上由 ubitux 回答:
Answered by ubitux on the FFmpeg IRC:
在 -filter_complex
链中使用 scale
和 overlay
像这样:
ffmpeg -y -ss 0 -t 0:0:30.0 -i 'video.mp4' -i '/watermark.png'
-filter_complex "[0:0] scale=400:225 [wm]; [wm][1:0] overlay=305:0 [out]"
-map "[out]" -b:v 896k -r 20 -an
'out.flv'
还通过 -i
加载水印, code>电影过滤器。
Also load the watermark via -i
rather than the movie
filter.
这篇关于水印如何缩放和缩放?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文