I am using the following command to add watermark in my video using font TIMESNEWROMAN:
ffmpeg -i input.webm -vf "drawtext=text='© Krishna':fontfile=C//:/Windows/Fonts/times.ttf:x=(main_w-text_w-10):y=(main_h-text_h-10):fontsize=32:fontcolor=black:box=1:[email protected]: boxborderw=5" -preset ultrafast output.mp4
Now, I want to provide the font TIMESNEWROMAN or any other font instead of fontfile path. Is it possible to do that?
font
optionIf your ffmpeg
was compiled with --enable-libfontconfig
you can use the font
option. From the drawtext filter documentation:
font
The font family to be used for drawing text. By defaultSans
.
ffmpeg -i input.webm -vf "drawtext=text='© Krishna':font='Times New Roman':x=(main_w-text_w-10):y=(main_h-text_h-10):fontsize=32:fontcolor=black:box=1:[email protected]:boxborderw=5" output.mp4
To check if your ffmpeg
has --enable-libfontconfig
just run the ffmpeg
command with no options and it will output the configuration. Then look for --enable-libfontconfig
.
ffmpeg
from BtbN which includes libfontconfig support.ffmpeg
from evermeet.cx or use Homebrew with the --with-fontconfig
option.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