[Libav-user] Bug in drawtext (FT_LOAD_*)?

Leandro Santiago leandrosansilva at gmail.com
Mon Jun 4 17:45:55 CEST 2012

Hello to all. I'm using the drawtext filter in a project and I
couldn't use the ft_load_flags option. I'm using ffmpeg 0.11, but I
also tested in 0.9.2 and from master branch. The results are the same.

What I have to to is write the text using the FT_LOAD_MONOCHROME
(defned in freetype.h), which print the text with opaque colors
(there's no "translucid" pixels in the border of a glyph), but if i
use, in the drawtext, the option "ft_load_flags=monochrome" the text
is not rendered. The same for other flags.

If I edit the filr vf_drawtext and change the line 202 (in 0.11) from:

{"monochrome","set monochrome",0, AV_OPT_TYPE_CONST,
{.dbl=FT_LOAD_MONOCHROME},INT_MIN, INT_MAX, 0, "ft_load_flags" },


{"monochrome","set monochrome",0, AV_OPT_TYPE_CONST,
"ft_load_flags" },

(I only added the FT_LOAD_RENDER flag)

The option "ft_load_flags=monochrome" has the effect I expect and the
text is correctly rendered.

Reading the libavfilter documentation and the drawtext source code I
couldn't find a way to use more than one parameter to ft_load_flags
option. I think something like ft_load_flags=monochrome|render|etc
should be  useful.

An easy test of the filter can be done with the parameter -vf
in ffmpeg of ffplay. This bug happens with all the ft_load_flags
options with exception of "render", the only one which use the
FT_LOAD_RENDER freetype flag.

Am I using the filter in a wrong way or this bug really exists?

Sent from my Atari

More information about the Libav-user mailing list