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

Stefano Sabatini stefasab at gmail.com
Tue Jun 5 10:48:39 CEST 2012


On date Monday 2012-06-04 12:45:55 -0300, Leandro Santiago encoded:
> 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" },
> 
> to:
> 
> {"monochrome","set monochrome",0, AV_OPT_TYPE_CONST,
> {.dbl=FT_LOAD_RENDER|FT_LOAD_MONOCHROME},INT_MIN, INT_MAX, 0,
> "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.

ft_load_flags=+monochrome will add the flag to the default value.


> 
> 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.

This is ft_load_flags=monochrome+render+...

Note that this is a standard feature of the ffmpeg parser, I don't
know if this is documented somewhere, you're welcome to create an
issue on trac if not or to add an example to the drawtext
documentation.

> An easy test of the filter can be done with the parameter -vf
> 'drawtext=text=Text:fontsize=30:fontfile=/path/to/Font.ttf:ft_load_flags=monochrome'
> 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?



More information about the Libav-user mailing list