如何添加文本到视频与ffmpeg没有vhook? [英] How to add text to video with ffmpeg without vhook?

查看:181
本文介绍了如何添加文本到视频与ffmpeg没有vhook?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为问题很简单。如何使用ffmpeg 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆