制作跳跃文字水印 [英] Making jumping text watermark
问题描述
我想做这样的事情: http://www.youtube.com/watch?v=AtM-f20XV4E 您会看到那里的水印每两秒钟改变一次位置...
I want to make something like these : http://www.youtube.com/watch?v=AtM-f20XV4E you can see there a watermark which change position every two second...
但是我需要它用于 drawtext 过滤器.
But I need it for drawtext filter.
因此,我已经意识到如何每隔几秒钟更改一次文本位置. 但不知道-如何保持新位置:) 我现在有一个代码.
So, I am already realize how to change a text position every few seconds.. but have no idea - how to keep new position :) there is a code which I have right now..
ffmpeg.exe -i myVideo.mov -c:v libx264 -preset veryfast -crf 25 -tune zerolatency -vendor ap10 -pix_fmt yuv420p -filter:v drawtext=fontfile=arial.ttf:text=MY_WATERMARK_TEXT:fontcolor=white:alpha=0.5:fontsize=74:box=1:boxcolor=red:x=if(eq(mod(t\,1)\,0)\,1000\,10):y=(h-text_h-line_h)/2 -c:a copy outVideo.mp4
每1秒钟将我的文本移动到新位置.但是请立即将位置改回原来的位置.
it move my text to new position every 1 second. but then immediately change position back of course.
所以,我坚持了这一点..如何保持新的位置? 也许我应该使用ld()和st()吗?
So, I stuck about that.. how to keep new position ? may be I should using ld() and st() ?
推荐答案
好.比我想象的要容易..
Ok. It was easier than I thought..
有一个答案:
ffmpeg.exe -i myVideo.mov -c:v libx264 -preset veryfast -crf 25 -tune zerolatency -vendor ap10 -pix_fmt yuv420p -filter:v drawtext=fontfile=arial.ttf:text=MY_WATERMARK_TEXT:fontcolor=white:alpha=0.5:fontsize=74:box=1:boxcolor=red:x=if(eq(mod(n\,18)\,0)\,sin(random(1))*w\,x):y=if(eq(mod(n\,18)\,0)\,sin(random(1))*h\,y) -c:a copy outVideo.mp4
这是主要部分:
x = if(eq(mod(n \,18)\,0)\,sin(random(1))* w \,x):
x=if(eq(mod(n\,18)\,0)\,sin(random(1))*w\,x):
y = if(eq(mod(n \,18)\,0)\,sin(random(1))* h \,y)
y=if(eq(mod(n\,18)\,0)\,sin(random(1))*h\,y)
在此示例中,Text_Watermark将在第18个第n帧中将位置随机更改为一个.
In this example Text_Watermark will change position to random one in every 18'nth frame.
这篇关于制作跳跃文字水印的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!