FFmpeg drawtext-无法从文件加载字体 [英] FFmpeg drawtext - Could not load fontface from file

查看:546
本文介绍了FFmpeg drawtext-无法从文件加载字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用 drawtext 参数在FFmpeg的视频顶部添加简单文本.每次我要执行此操作时,都会返回错误:

I've try to add simple text on top of video with FFmpeg using drawtext parameter. Every time i'm going to do this, error is returned:

无法从文件'arial.ttf'中加载字体:无法打开资源

Could not load fontface from file 'arial.ttf': cannot open resource

为了指示字体的位置,我使用了以下方法:

To indicate the location of the font I used the following methods:

ffmpeg -i C:\Test\rec\vid_1321909320.avi -vf drawtext=fontfile=arial.ttf:text=test -sameq vid_1321909320.flv
ffmpeg -i C:\Test\rec\vid_1321909320.avi -vf drawtext=fontfile=C:\Windows\Fonts\arial.ttf:text=test -sameq vid_1321909320.flv

全部失败.有没有人有使用ffmpeg添加文本的经验?

All have failed. Does anyone have experience with adding text using ffmpeg?

FFMPEG version: N-34549-g13b7781 build on Nov 6 2011

推荐答案

字体文件的路径中不能包含冒号,因为冒号是ffmpeg中的关键分隔符. 我遇到了相同的问题.

You cannot have a colon in the path to your font file as the colon acts as a key sepperator in ffmpeg. I had the same problem.

ffmpeg -i C:\Test\rec\vid_1321909320.avi -vf drawtext=fontfile=/Windows/Fonts/arial.ttf:text=test -sameq vid_1321909320.flv

这篇关于FFmpeg drawtext-无法从文件加载字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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