FFmpeg drawtext - Could not load fontface from file [closed] FFmpeg drawtext - Could not load fontface from file [closed] windows windows

FFmpeg drawtext - Could not load fontface from file [closed]


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.

try:

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


A colon ":" and a backslash "\" have special meaning when specifying the parameters for drawtext. So what you can do is to escape them by converting ":" to "\:" and "\" to "\\".Also you can enclose the path to your font file in single quotes incase the path contains spaces.

So you will have

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


I was also having trouble with ffmpeg recognizing Windows paths. I finally just put the font Arial.ttf in the same folder as the input file and it worked.

[drawtext @ 03C66EA0] Key '/Windows/Fonts/Arial.ttf: text' not found.[drawtext @ 03C66E00] Error parsing options string: 'fontfile=C:/Windows/Fonts/Arial.ttf: text=Test Text:x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2'Error initializing filter 'drawtext' with args 'fontfile=C:/Windows/Fonts/Arial.ttf: text=Test Text:x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2'Error opening filters!