在ffmpeg字体文件中使用Google字体 [英] Use Google Fonts In ffmpeg fontfile

查看:395
本文介绍了在ffmpeg字体文件中使用Google字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的ffmpeg视频创作中使用Google字体输入文字.这是我的东西,根本无法使用.

I am wanting to use Google Fonts in my ffmpeg video creations for text. Here is what I have and it's not working at all.

$font = "//fonts.googleapis.com/css?family=Aclonica";

$cmd .= "drawtext=enable='between(t,".$fi.",".$li.")':fontfile=".$font.":fontsize=".$fontsize.":fontcolor=".$color.":x=(w-text_w)/2:y=(h/2)+".$n.":text='".$arr[$j]."',";

当然,这适用于.ttf字体,但我真的很想使用Google字体.

Of course, this works with .ttf fonts but I really want to use Google Fonts.

我还尝试了$font = "https://fonts.googleapis.com/css?family=Aclonica"也不起作用.

I have also tried $font = "https://fonts.googleapis.com/css?family=Aclonica" that does not work either.

我觉得ffmpeg不使用woff2字体,但是我看到一个做到这一点的网站,我只是不能肯定地说100%他们在创作中使用了Google字体,但是他们确实在选择中使用了它们字体使我相信他们在视频创作中会使用它们.

I have a feeling that ffmpeg does not use woff2 fonts but I have seen a site that does this I just can't say 100% for sure that they use Google Fonts in the creation, but they do use them in the selection of the font which leads me to believe they use them in the creation of the video.

推荐答案

如注释中所述,ffmpeg无法处理URL传递的字体,而是期望使用该字体的本地可访问文件.

As discussed in the comments, ffmpeg can not handle a font that is passed by URL but rather expects a locally reachable file with the font.

这篇关于在ffmpeg字体文件中使用Google字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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