ffmpeg drawtext过滤器,具有放大效果 [英] ffmpeg drawtext filter with zoom in effect
本文介绍了ffmpeg drawtext过滤器,具有放大效果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用绘制文本过滤器在视频上显示文本.我需要在文本上添加放大和缩小过滤器.有没有用于放大和缩小视频中文本的命令.
I am using draw text filter to display text on video.i need to add zoom in and zoom out filter on text. is there any command for zoom in and zoom out the text on video.
推荐答案
一种方法是使用带有动画转换标签的ASS字幕( \ t
):
One method is to use ASS subtitles with the animated transform tag (\t
):
{\an5\fscx0\fscy0\t(0,500,\fscx100\fscy100)}Text zoom
-
\ an5
中心文字 -
\ fscx0
将字体x缩放比例设置为0%. -
\ fscy0
将y字体缩放比例设置为0%. -
t(0,500,\ fscx100 \ fscy100)
在500毫秒内将\ fscx
和\ fscy
设置为100%. \an5
Center text\fscx0
Set font x scale to 0%.\fscy0
Set font y scale to 0%.t(0,500,\fscx100\fscy100)
In 500 milliseconds set\fscx
and\fscy
to 100%.
这在Aegisub中很容易做到.
This is easy to do in Aegisub.
然后使用字幕过滤器 ffmpeg 命令>.
Then run your ffmpeg
command using the subtitles filter.
ffmpeg -i input -filter_complex "subtitles=zoom.ass" output
示例ASS文件,其中文本将放大然后缩小.
Example ASS file where text will zoom in and then zoom out.
[Script Info]
; Script generated by Aegisub 3.2.2
; http://www.aegisub.org/
Title: Default Aegisub file
ScriptType: v4.00+
WrapStyle: 0
ScaledBorderAndShadow: yes
YCbCr Matrix: None
[Aegisub Project Garbage]
Active Line: 1
[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: Default,Arial,20,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,0,0,0,0,100,100,0,0,1,2,2,2,10,10,10,1
[Events]
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,0:00:00.00,0:00:03.00,Default,,0,0,0,,{\fscx0\fscy0\t(0,500,\fscx100\fscy100)}zoom text
Dialogue: 0,0:00:03.00,0:00:04.00,Default,,0,0,0,,{\fscx100\fscy100\t(0,500,\fscx0\fscy0)}zoom text
这篇关于ffmpeg drawtext过滤器,具有放大效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文