Use Google Fonts In ffmpeg fontfile

不想你离开。 提交于 2020-11-30 01:38:57

问题


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]."',";

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

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

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.


回答1:


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.



来源:https://stackoverflow.com/questions/60581054/use-google-fonts-in-ffmpeg-fontfile

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!