How can we specify style in drawtext filter. Example, draw 'Hello' in a regular font, but it should be bold, in italics and underlined. Is this possible?
Maybe this answer is late, but, from the FFMPEG documentation: http://ffmpeg.org/ffmpeg-all.html
Use fontconfig to set the font. Note that the colons need to be escaped.
drawtext='fontfile=Linux Libertine O-40\:style=Semibold:text=FFmpeg'
You have to configure the fontconfig file of course, set up your desired fonts (be careful to have all the styles that you need) in the fonts location and then run the drawtext with the font family name followed by ':style='.
Example:
-vf "drawtext='fontfile=DejaVuSans\:style=ExtraLight:text=FFmpeg'"
This worked for me in the console and as a php shell exec command. You can use whatever font style, as long as (for the style and font family that you chose), there's a font file in the font directory that follows this rule: FontFamilyName-StyleName . I really hope that this helps!
You can specify the target font:
drawtext= fontfile=fonts/path/Arial-Bold.ttf :text=FFmpeg
The font family should have proper file for every style you want to use.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With