我正在使用带有ffmpeg 64位静态版本的Windows 8.1 Pro,尝试运行以下cmd
"C:\ffmpeg\bin\ffmpeg.exe" -i "C:\ffmpeg\v.mp4" -preset veryslow -crf 22
-vf "drawtext=fontfile=C:/Windows/Fonts/Arial/ariblk.ttf: text='%
{localtime}': x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000000@1"
"o.mp4"
返回错误
[Parsed_drawtext_0 @ 0000000004c5cf20] Could not load font "C": cannot open resource
似乎问题在于这部分代码是由半冒号引起的:终止字符串。
fontfile=C:/Windows/Fonts/Arial/ariblk.ttf:
但是,我试图在后面的节目中使用backslahses逃避它,但错误仍然存在
fontfile=C\:/Windows/Fonts/Arial/ariblk.ttf:
错误
[Parsed_drawtext_0 @ 0000000004c5cf20] Could not load font "C": cannot open resource
和
fontfile=C/:/Windows/Fonts/Arial/ariblk.ttf
错误
[Parsed_drawtext_0 @ 0000000004c5cf20] Could not load font "C/": cannot open resource
最后
fontfile='C:'/Windows/Fonts/Arial/ariblk.ttf
错误
[Parsed_drawtext_0 @ 0000000004c5cf20] Could not load font "C": cannot open resource
我怎样才能解决这个问题?
由于
答案 0 :(得分:3)
尝试:
fontfile=C\\:\\\\Windows\\\\Fonts\\\\ariblk.ttf
有几个问题需要解决:
您需要使用:
转义\\:
以及使用\
\\\\
第二部分是Windows如何处理字体的位置。您可能会认为这些字体位于名为Arial的文件夹下,但它们实际上只是在资源管理器中按照这种方式进行分组。 Arial Black在字体根中的实际路径。 c:\Windows\Fonts\ariblk.tff
答案 1 :(得分:0)
你可能需要逃避逃跑...
fontfile=C\\:/Windows/...
信用到这里: https://superuser.com/questions/589214/ffmpeg-drawtext-initialization-error
答案 2 :(得分:0)
FileOutputStream
或
"drawtext=fontfile='c\:/Windows/fonts/ariblk.ttf': ...