[FFmpeg-user] Some Tibetan characters aren't rendered correctly with drawtext filter.

张一环 the at daily.show
Sat Jun 20 16:06:07 EEST 2020

I'm trying to use ffmpeg drawtext filter to render Tibetan text to videos. But some characters aren't rendered correctly.

for example:


Expected render output:

Actual render output:

Here's my ffmpeg command line:
ffmpeg -i input.mp4 -filter_complex "drawtext=fontsize=80:fontcolor=black:fontfile=himalaya.ttf:shadowx=1:shadowy=1:text='སྤྱི་སྟེགས':x=0:y=0" -c:v libx264 -b:v 400k -c:a copy output.mp4

The font himalaya.ttf (Microsoft Himalaya) is the default built-in font for Tibetan on Windows. (See https://docs.microsoft.com/en-us/typography/font-list/microsoft-himalaya )

I tried many other Tibetan fonts, and many ffmpeg versions, problem exists anyway.

All of those fonts are rendered correctly in other places such as a web browser.

I asked a question on stackoverflow (Link: https://stackoverflow.com/questions/62458321/ffmpeg-drawtext-support-for-tibetan-fonts ),
and now I know this unlikely freetype fault, I tired using harfbuzz as shaping engine, to render Tibetan in an ass subtitle, it works correctly.

But the problem is, ffmpeg drawtext filter does not support to specify a shaping engine (use harfbuzz rather than fribidi).

So this is a bug? Thank you.

More information about the ffmpeg-user mailing list