如何添加文本到视频与ffmpeg没有vhook? [英] How to add text to video with ffmpeg without vhook?
问题描述
使用ubuntu并安装最新的ffmpeg版本。
来自Ubuntu 10.04的FFmpeg似乎并不支持过滤器,因此您必须获得更新版本。您可以按照一步一步的有关其他参数的更多详细信息。
I think question is simple enough. How to add text with ffmpeg vhook is deprecated and i couldn't find any easier solution.
Using ubuntu and installed latest ffmpeg version.
FFmpeg from Ubuntu 10.04 does not appear to support filters, so you will have to get a more recent version. You can follow a step-by-step guide to compile ffmpeg on Ubuntu, or you can simply download a Linux build of ffmpeg.
Note that if you follow the compile guide you will need to additionally install libfreetype6-dev
as a dependency and then add --enable-libfreetype
to your ffmpeg ./configure
.
This example command will add the words "Stack Overflow" to the video with a white background and centered in the middle of the video:
ffmpeg -i input -filter:v "drawtext=fontsize=30:box=1:fontfile=/usr/share/fonts/TTF/Vera.ttf:text='Stack Overflow':x=(w-text_w)/2:y=(h-text_h-line_h)/2" output
See the drawtext
documentation for more details on additional parameters.
这篇关于如何添加文本到视频与ffmpeg没有vhook?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!