Cannot render non-ASCII characters with ffmpeg's drawtext
3
votes
1
answer
2764
views
Using the
Note from left to right:
AT - Double spaced characters
05 - Simple numbers
ーポン - CJK characters
攢ð - AltGr + a,b,c,d in my locale (en_GB.UTF-8)
At first I assumed the font was at fault, but I've checked numerous fonts and they have the relevant glyphs. Indeed my entire system has no problems with these characters at all. I then assumed it must be
So I'm back to assuming there is something wrong with my environment. I've tried on Ubuntu Trusty and Ubuntu Xenial but the results are the same.
$ locale
LANG=en_GB.UTF-8
LANGUAGE=en_GB:en
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=
$ ffmpeg
ffmpeg version 3.2.4-static http://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 5.4.1 (Debian 5.4.1-5) 20170205
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-5 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg
libavutil 55. 34.101 / 55. 34.101
libavcodec 57. 64.101 / 57. 64.101
libavformat 57. 56.101 / 57. 56.101
libavdevice 57. 1.100 / 57. 1.100
libavfilter 6. 65.100 / 6. 65.100
libswscale 4. 2.100 / 4. 2.100
libswresample 2. 3.100 / 2. 3.100
libpostproc 54. 1.100 / 54. 1.100
$ convert -version
Version: ImageMagick 6.7.7-10 2017-05-26 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP
I don't know where else to look given that my locale appears to be correct, and any font I use correctly renders the font, but when passed to either
drawtext
filter in ffmpeg
I am unable to use anything but ASCII characters.
This command creates a five second test video, as expected (nothing pretty):
ffmpeg -f lavfi -i testsrc -to 5 -vf "drawtext=text='AT 05 ーポン 攢ð':fontcolor=white" test.mpg
But the output fails to render any non-ASCII characters:

ffmpeg
but I tried the following:
convert -background black -size 800x480 -fill "#ff0080" -family "Ubuntu Mono" -pointsize 72 -gravity center label:'AT 05 ーポン 攢ð' output.png
The result being:

ffmpeg
or convert
the text shown is useless.
I've done the usual hours and hours of Googling to no avail. I'm amazed nobody else has seen this problem before me.
Can anyone shed any light?
Asked by Ken Sharp
(559 rep)
Jun 13, 2017, 10:05 PM
Last activity: May 21, 2025, 12:04 AM
Last activity: May 21, 2025, 12:04 AM