简体   繁体   English

MLT框架。 如何在视频中心添加文本或图像水印并向其中添加zoomIn动画?

[英]MLT Framework. How to add text or image watermark on the center of video and add zoomIn animation to it?

Tried this: 试过这个:

-filter watermark:"welcome.jpg" in=0 out=320 composite.progressive=1 producer.align=centre composite.valign=middle composite.halign=center crop_to_fill=1 composite.geometry="0=0,0:80%x80%:0%;60=0,0:100%x100%:100%;260=0,0:120%x120%:100%;320=0,0:120%x120%:0%"

But it doesn't increase size of watermark, it just moves it to right bottom side... 但这并不会增加水印的大小,它只是将其移动到右下侧...

I don't know of a way to animate a center zoom only using the watermark filter. 我不知道仅使用水印滤镜对中心缩放进行动画处理的方法。 But it is possible to animate a center zoom using the affine transition. 但是可以使用仿射过渡为中心变焦设置动画。 You would need to use two tracks: one with the background video and another with the text to be animated. 您将需要使用两条轨道:一条带有背景视频,另一条带有要动画的文本。 Here is an example: 这是一个例子:

melt color:blue in=0 out=320 -track welcome.jpg in=0 out=320 -transition affine valign=middle halign=center scale=1 fill=1 geometry="0=10%,10%:80%x80%:0%;60=0,0:100%x100%:100%;260=-10%,-10%:120%x120%:100%;320=-10%,-10%:120%x120%:0%"

The key is that the position of the watermark is relative to the left corner. 关键是水印的位置是相对于左角的。 So, in addition to animating the size, you also need to animate the x and y position as shown in the example. 因此,除了设置大小动画外,还需要对x和y位置进行动画处理,如示例所示。

Also note that the animation will interpolate the size and position for each frame - but the position is rounded to the nearest pixel. 还要注意,动画将插值每帧的大小和位置-但位置会四舍五入到最接近的像素。 So the motion may not be smooth. 因此,运动可能不平稳。 That is a known limitation to the animation capabilities in MLT. 这是MLT中动画功能的已知限制。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM