Search code examples
ffmpegquicktime

ffmpeg giving text not found error


arial.ttf is present in C:\Windows\Fonts folder. running

ffmpeg.exe -i D:\imagesequence\test.mov -vf drawtext="arial.ttf=':text='TEST'" D:\imagesequence\testo.mov

or

ffmpeg.exe -i D:\imagesequence\test.%04d.jpg -vf drawtext="arial.ttf=':text='TEST'" D:\imagesequence\testo.mov

results in

ffmpeg.exe -i D:\imagesequence\test.%04d.jpg -vf drawtext=fontf
ile="arial.ttf=':text='TEST'" D:\imagesequence\testo.mov
ffmpeg version N-34549-g13b7781, Copyright (c) 2000-2011 the FFmpeg developers
  built on Nov  6 2011 22:02:08 with gcc 4.6.1
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-ru
ntime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libope
ncore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --en
able-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger -
-enable-libspeex --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwben
c --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-
libxvid --enable-zlib
  libavutil    51. 24. 0 / 51. 24. 0
  libavcodec   53. 28. 0 / 53. 28. 0
  libavformat  53. 19. 0 / 53. 19. 0
  libavdevice  53.  4. 0 / 53.  4. 0
  libavfilter   2. 47. 0 /  2. 47. 0
  libswscale    2.  1. 0 /  2.  1. 0
  libpostproc  51.  2. 0 / 51.  2. 0
Input #0, image2, from 'D:\imagesequence\test.%04d.jpg':
  Duration: 00:00:01.24, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: mjpeg, yuvj420p, 768x576 [SAR 1:1 DAR 4:3], 25 fps, 25 t
br, 25 tbn, 25 tbc
File 'D:\imagesequence\testo.mov' already exists. Overwrite ? [y/N] y
w:768 h:576 pixfmt:yuvj420p tb:1/1000000 sar:1/1 sws_param:
[drawtext @ 01C80260] Could not load fontface from file 'arial.ttf=': cannot ope
n resource
Error initializing filter 'drawtext' with args 'fontfile=arial.ttf=:text=TEST'
Error opening filters!

Solution

  • LordNeckbeard is correct, you need to specify the full path to the font you're trying to use with "fontfile." Also, if your input and output files are in the same directory, you don't need to specify their respective directories (saves command line hassle). In your case, this should work:

    ffmpeg.exe -i test.mov -vf drawtext=fontfile=/Windows/Fonts/arial.ttf:text="TEST" testo.mov