[FFmpeg-trac] #11549(undetermined:new): Ffmpeg fontconfig broken on windows?
FFmpeg
trac at avcodec.org
Mon Apr 21 11:28:44 EEST 2025
#11549: Ffmpeg fontconfig broken on windows?
-------------------------------------+-------------------------------------
Reporter: mytait | Type: defect
Status: new | Priority: normal
Component: | Version:
undetermined | unspecified
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Summary of the bug:
the drawtext command will not find a font on windows in V7.x unless the
font file is provided. as per documentation that is only necessary "if the
fontconfig support is disabled." (and if you need your own font file of
course)
normally even not providing a font works as there is a default value. On
windows v7.x it does not anymore. (tested on 7.0.1 and 7.1.1
in linux and macos it works as expected just providing the font name e.g.
"Times New Roman" or "arial". Also windows V5.x works as expected.
How to reproduce:
create a text file named test.mkv and then draw a text on it
{{{
% ffmpeg -y -f lavfi -i color=c=white:s=1280x720:r=30 -f lavfi -i
anullsrc=r=44100:cl=stereo -t 10 -c:v libx264 -c:a aac test.mkv
% ffmpeg -y -i test.mkv -vf "drawtext=font='arial':text='test'" out.mkv
Input #0, matroska,webm, from 'test.mkv':
Metadata:
ENCODER : Lavf61.7.100
Duration: 00:00:10.02, start: -0.023000, bitrate: 16 kb/s
Stream #0:0: Video: h264 (High), yuv420p(tv, progressive), 1280x720 [SAR
1:1 DAR 16:9], 30 fps, 30 tbr, 1k tbn
Metadata:
ENCODER : Lavc61.19.101 libx264
DURATION : 00:00:10.000000000
Stream #0:1: Audio: aac (LC), 44100 Hz, stereo, fltp
Metadata:
ENCODER : Lavc61.19.101 aac
DURATION : 00:00:10.023000000
Fontconfig error: Cannot load default config file: No such file: (null)
}}}
This works:
{{{
ffmpeg -y -i test.mkv -vf
"drawtext=fontfile=C\\:/Windows/fonts/arial.ttf:text='test'" out.mkv
}}}
but providing a font everytime breaks the elegancy of the former command
being OS independent (only providing the font name and not filename with
path)
the used version have all the required options as per documentation:
--enable-libfreetype --enable-libharfbuzz --enable-libfontconfig
--enable-libfribidi
{{{
ffmpeg version 7.0.1-full_build-www.gyan.dev Copyright (c) 2000-2024 the
FFmpeg developers
built with gcc 13.2.0 (Rev5, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-
w32threads --disable-autodetect --enable-fontconfig --enable-iconv
--enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma
--enable-libsnappy --enable-zlib --enable-librist --enable-libsrt
--enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray
--enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption
--enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libxevd
--enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp
--enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxeve
--enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg
--enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r
--enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-
liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-
amf --enable-cuda-llvm --enable-cuvid --enable-dxva2 --enable-d3d11va
--enable-d3d12va --enable-ffnvcodec --enable-libvpl --enable-nvdec
--enable-nvenc --enable-vaapi --enable-libshaderc --enable-vulkan
--enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme
--enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb
--enable-libmp3lame --enable-libshine --enable-libtheora --enable-
libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc
--enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-
libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-
libflite --enable-libmysofa --enable-librubberband --enable-libsoxr
--enable-chromaprint
libavutil 59. 8.100 / 59. 8.100
libavcodec 61. 3.100 / 61. 3.100
libavformat 61. 1.100 / 61. 1.100
libavdevice 61. 1.100 / 61. 1.100
libavfilter 10. 1.100 / 10. 1.100
libswscale 8. 1.100 / 8. 1.100
libswresample 5. 1.100 / 5. 1.100
libpostproc 58. 1.100 / 58. 1.100
}}}
{{{
ffmpeg version 7.1.1-full_build-www.gyan.dev Copyright (c) 2000-2025 the
FFmpeg developers
built with gcc 14.2.0 (Rev1, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-shared --disable-
w32threads --disable-autodetect --enable-fontconfig --enable-iconv
--enable-gnutls --enable-lcms2 --enable-libxml2 --enable-gmp --enable-
bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist
--enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth
--enable-libbluray --enable-libcaca --enable-libdvdnav --enable-libdvdread
--enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-
libdav1d --enable-libdavs2 --enable-libopenjpeg --enable-libquirc
--enable-libuavs3d --enable-libxevd --enable-libzvbi --enable-libqrencode
--enable-librav1e --enable-libsvtav1 --enable-libvvenc --enable-libwebp
--enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxeve
--enable-libxvid --enable-libaom --enable-libjxl --enable-libvpx --enable-
mediafoundation --enable-libass --enable-frei0r --enable-libfreetype
--enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-
libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-
llvm --enable-cuvid --enable-dxva2 --enable-d3d11va --enable-d3d12va
--enable-ffnvcodec --enable-libvpl --enable-nvdec --enable-nvenc --enable-
vaapi --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-
opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-
libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-
libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc
--enable-libcodec2 --enable-libilbc --enable-libgsm --enable-liblc3
--enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-
libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-
libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
libavutil 59. 39.100 / 59. 39.100
libavcodec 61. 19.101 / 61. 19.101
libavformat 61. 7.100 / 61. 7.100
libavdevice 61. 3.100 / 61. 3.100
libavfilter 10. 4.100 / 10. 4.100
libswscale 8. 3.100 / 8. 3.100
libswresample 5. 3.100 / 5. 3.100
libpostproc 58. 3.100 / 58. 3.100
}}}
--
Ticket URL: <https://trac.ffmpeg.org/ticket/11549>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list