<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div>Hi,</div><div> </div><div><font face="Courier New">libfreetype is used to draw text on video stream.</font><br></div><div><a href="http://ffmpeg.org/ffmpeg-filters.html#drawtext-1">http://ffmpeg.org/ffmpeg-filters.html#drawtext-1</a></div><div>There are 3 important syntaxes in the filter of drawtext.</div><div> </div><div><dt><samp>fontsize</samp></dt><dd><p>The font size to be used for drawing text. The default value of <var>fontsize</var> is 16.</p></dd><dt><samp></samp></dt></div><div><dt><samp>text_h, th</samp></dt><dd><p>the height of the rendered text</p></dd><dt><samp>text_w, tw</samp></dt><dd><p>the width of the rendered text</p></dd></div><div> </div><div>However, text_h and text_w can only be used in filtergraph description. I want to know the height and width of the rendered text that corresponds to some fondsize, such as fondsize=20. It means, how to calculate the pixel number of rendered text in width and height?<br></div><div><br>Thanks!<br><br></div><div style="position: relative; zoom: 1;"></div><div id="divNeteaseMailCard"></div><div><br></div><pre><br>At 2016-04-26 17:20:13, "Nicolas George" <george@nsup.org> wrote:
>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
</pre></div><br><br><span title="neteasefooter"><p> </p></span>