[Libav-user] what is the relationship between fontsize and image resolution in drawtext filter

Nicolas George george at nsup.org
Tue Apr 26 11:20:13 CEST 2016


L'octidi 8 floréal, an CCXXIV, qw a écrit :
> I want to use drawtext filter to put some string on video stream. What is
> the relationship between fontsize and image resolution in drawtext filter?

The size is the body height of the font in pixels, nothing fancy.

> If fontsize is set to 20, what is the height and width of rendered text?

It depends on the font.

For the height, the rule of thumb is that the body size is the distance
between the top of the tallest glyph (except sometimes accented ones) and
the bottom of the deepest one, typically something like the top of a
parenthesis and the bottom of a p or q.

For the width, it depends completely, because not all glyphs have the same
width, and you need to take kerning into account too.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20160426/f65e6b36/attachment.sig>


More information about the Libav-user mailing list