FFMPEG - 无法加载字体“C”: - 无法转义分号

1 ffmpeg

我正在使用带有 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"
Run Code Online (Sandbox Code Playgroud)

哪个返回错误

[Parsed_drawtext_0 @ 0000000004c5cf20] Could not load font "C": cannot open resource
Run Code Online (Sandbox Code Playgroud)

似乎问题出在由分号引起的这部分代码周围:终止字符串。

fontfile=C:/Windows/Fonts/Arial/ariblk.ttf:
Run Code Online (Sandbox Code Playgroud)

但是,我尝试在以下 ecerpts 中使用反斜杠对其进行转义,但错误仍然存​​在

fontfile=C\:/Windows/Fonts/Arial/ariblk.ttf:
Run Code Online (Sandbox Code Playgroud)

错误

[Parsed_drawtext_0 @ 0000000004c5cf20] Could not load font "C": cannot open resource
Run Code Online (Sandbox Code Playgroud)

fontfile=C/:/Windows/Fonts/Arial/ariblk.ttf
Run Code Online (Sandbox Code Playgroud)

错误

[Parsed_drawtext_0 @ 0000000004c5cf20] Could not load font "C/": cannot open resource
Run Code Online (Sandbox Code Playgroud)

最后

fontfile='C:'/Windows/Fonts/Arial/ariblk.ttf
Run Code Online (Sandbox Code Playgroud)

错误

[Parsed_drawtext_0 @ 0000000004c5cf20] Could not load font "C": cannot open resource
Run Code Online (Sandbox Code Playgroud)

我怎样才能解决这个问题?

谢谢

小智 6

尝试:

fontfile=C\\:\\\\Windows\\\\Fonts\\\\ariblk.ttf
Run Code Online (Sandbox Code Playgroud)

有几个问题需要解决:

你需要逃避:\\:以及逃生\\\\\

第二部分是 Windows 处理字体位置的方式。您可能会认为这些字体位于名为 Arial 的文件夹下,但实际上它们只是在资源管理器中按这种方式分组。字体根目录中 Arial Black 的实际路径。c:\Windows\Fonts\ariblk.tff