user10369: I have got this error message when using ffmpeg
[Parsed_drawtext_0 @ 03bdc300] Could not load font "/Library/Fonts/DroidSansMono.ttf": cannot open resource
Fontconfig error: Cannot load default config file
[Parsed_drawtext_0 @ 03bdc300] impossible to init fontconfig
[AVFilterGraph @ 03d9b840] Error initializing filter 'drawtext' with args 'fontsize=15:fontfile=/Lib
rary/Fonts/DroidSansMono.ttf:timecode=00\:00\:00\:00:rate=25:text=TCR\::fontsize=72:fontcolor=white:
boxcolor=0x000000AA:box=1:x=860-text_w/2:y=960'
Error opening filters!

Does anyone know how can I resolve this issue?
I'm using ffmpeg on Windows 7. I've downloaded ffmpeg from ffmpeg.zeranoe.com/builds
This is what I entered and what came up:
c:\ffmpeg\bin>ffmpeg -i in.mts -vf "drawtext=fontfile=/usr/share/fonts/truetype/DroidSans.ttf: timec
ode='09\:57\:00\:00': r=25: \x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000000@1"
-an -y out.avi
ffmpeg version N-70634-g3bedc99 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.9.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzli
b --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libblu
ray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-
libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrw
b --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr -
-enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --
enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enab
le-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enab
le-zlib
  libavutil      54. 20.100 / 54. 20.100
  libavcodec     56. 26.100 / 56. 26.100
  libavformat    56. 25.101 / 56. 25.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 12.100 /  5. 12.100
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mpegts, from 'in.mts':
  Duration: 00:00:23.42, start: 1.040000, bitrate: 9937 kb/s
  Program 1
    Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p, 1440x1080 [SAR 4:3 DAR 16:
9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 256 kb/s
    Stream #0:2[0x1200]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090), 1920x1080
[Parsed_drawtext_0 @ 02ac2f20] Could not load font "/usr/share/fonts/truetype/DroidSans.ttf": cannot
 open resource
Fontconfig error: Cannot load default config file
[Parsed_drawtext_0 @ 02ac2f20] impossible to init fontconfig
[AVFilterGraph @ 03cdb840] Error initializing filter 'drawtext' with args 'fontfile=/usr/share/fonts
/truetype/DroidSans.ttf: timecode=09\:57\:00\:00: r=25: x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box
=1: boxcolor=0x00000000@1'
Error opening filters!

c:\ffmpeg\bin>


user12423: Using this drawtext in a program I wrote to embed Created dates into images, I found that you have to escape some characters like colons and backslashes using some versions of FFmpeg with the '\' escape character as you did in the timecode sequence. Also enclose paths in single quotes for possible spaces in path or name:
drawtext=fontfile='c\\:\\\Windows\\\Fonts\\\Times.ttf'

or
ffmpeg -i in.mts -vf "drawtext=fontfile='C\\:\\\Windows\\\fonts\\\truetype\\\DroidSans.ttf': timecode='09\\:57\\:00\\:00': r=25: \\x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000000@1" -an -y out.avi

Also some fonts contain multiple .ttf files like Times New Roman.  Double clicking this shows Times New Roman Regular, Times New Roman Bold, etc. Times new Roman Regular properties shows its name is Times.ttf.  Be sure to use the correct one.



user10369: Got it. The error is cuased by the font location in the command is of a Linux computer. The font location need to be different for windows.
The error caused by this line in the command: drawtext=fontfile=/usr/share/fonts/truetype/DroidSans.ttf
The above line does not work in Windows. 
For windows change to: drawtext=fontfile=/Windows/Fonts/arial.ttf

10369: <p>I have got this error message when using ffmpeg</p>

<pre><code>[Parsed_drawtext_0 @ 03bdc300] Could not load font "/Library/Fonts/DroidSansMono.ttf": cannot open resource
Fontconfig error: Cannot load default config file
[Parsed_drawtext_0 @ 03bdc300] impossible to init fontconfig
[AVFilterGraph @ 03d9b840] Error initializing filter 'drawtext' with args 'fontsize=15:fontfile=/Lib
rary/Fonts/DroidSansMono.ttf:timecode=00\:00\:00\:00:rate=25:text=TCR\::fontsize=72:fontcolor=white:
boxcolor=0x000000AA:box=1:x=860-text_w/2:y=960'
Error opening filters!
</code></pre>

<p>Does anyone know how can I resolve this issue?</p>

<p>I'm using ffmpeg on Windows 7. I've downloaded ffmpeg from ffmpeg.zeranoe.com/builds</p>

<p>This is what I entered and what came up:</p>

<pre><code>c:\ffmpeg\bin&gt;ffmpeg -i in.mts -vf "drawtext=fontfile=/usr/share/fonts/truetype/DroidSans.ttf: timec
ode='09\:57\:00\:00': r=25: \x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000000@1"
-an -y out.avi
ffmpeg version N-70634-g3bedc99 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.9.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzli
b --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libblu
ray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-
libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrw
b --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr -
-enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --
enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enab
le-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enab
le-zlib
  libavutil      54. 20.100 / 54. 20.100
  libavcodec     56. 26.100 / 56. 26.100
  libavformat    56. 25.101 / 56. 25.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 12.100 /  5. 12.100
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mpegts, from 'in.mts':
  Duration: 00:00:23.42, start: 1.040000, bitrate: 9937 kb/s
  Program 1
    Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p, 1440x1080 [SAR 4:3 DAR 16:
9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 256 kb/s
    Stream #0:2[0x1200]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090), 1920x1080
[Parsed_drawtext_0 @ 02ac2f20] Could not load font "/usr/share/fonts/truetype/DroidSans.ttf": cannot
 open resource
Fontconfig error: Cannot load default config file
[Parsed_drawtext_0 @ 02ac2f20] impossible to init fontconfig
[AVFilterGraph @ 03cdb840] Error initializing filter 'drawtext' with args 'fontfile=/usr/share/fonts
/truetype/DroidSans.ttf: timecode=09\:57\:00\:00: r=25: x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box
=1: boxcolor=0x00000000@1'
Error opening filters!

c:\ffmpeg\bin&gt;
</code></pre>
 12423: <p>Using this drawtext in a program I wrote to embed Created dates into images, I found that you have to escape some characters like colons and backslashes using some versions of FFmpeg with the '<code>\</code>' escape character as you did in the timecode sequence. Also enclose paths in single quotes for possible spaces in path or name:</p>

<pre><code>drawtext=fontfile='c\\:\\\Windows\\\Fonts\\\Times.ttf'
</code></pre>

<p>or</p>

<pre><code>ffmpeg -i in.mts -vf "drawtext=fontfile='C\\:\\\Windows\\\fonts\\\truetype\\\DroidSans.ttf': timecode='09\\:57\\:00\\:00': r=25: \\x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000000@1" -an -y out.avi
</code></pre>

<p>Also some fonts contain multiple <code>.ttf</code> files like Times New Roman.  Double clicking this shows Times New Roman Regular, Times New Roman Bold, etc. Times new Roman Regular properties shows its name is <code>Times.ttf</code>.  Be sure to use the correct one.</p>

<p><a href="https://i.stack.imgur.com/zX6fu.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zX6fu.jpg" alt="Font Main Folder"></a></p>

<p><a href="https://i.stack.imgur.com/XR0nf.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XR0nf.jpg" alt="Actual Fonts and Names"></a></p>
 10369: <p>Got it. The error is cuased by the font location in the command is of a Linux computer. The font location need to be different for windows.</p>

<p>The error caused by this line in the command: <code>drawtext=fontfile=/usr/share/fonts/truetype/DroidSans.ttf</code></p>

<p>The above line does not work in Windows. </p>

<p>For windows change to: <code>drawtext=fontfile=/Windows/Fonts/arial.ttf</code></p>
