FFMPEG Command to Add Text Overlay on Video as Watermark With Custom Font & Colors in Terminal
295 views
Jun 3, 2025
ffmpeg -i input.mp4 -vf "drawtext=fontfile=C\\:/Windows/Fonts/consola.ttf:text='CODING SHIKSHA':fontcolor=yellow:fontsize=72:box=1:boxcolor=0x000000AA:x=(w-text_w)/2:y=(h-text_h)/2" -c:a copy output.mp4 ffmpeg -i input.mp4 -vf "drawtext=fontfile=C\\:/Windows/Fonts/consola.ttf:text='CODING SHIKSHA':fontcolor=yellow:fontsize=72:shadowcolor=black:shadowx=2:shadowy=2:x=(w-text_w)/2:y=(h-text_h)/2" -c:a copy output.mp4
View Video Transcript
0:00
uh hello guys welcome to this video so
0:02
in this video I will show you how to add
0:05
text as a
0:09
watermark so if you basically want to
0:11
add some kind of text as an overlay
0:13
inside your video so you can use ffmppg
0:17
command for this so ffmpg is an
0:20
open-source audio video processing
0:21
library so we have this input file here
0:24
what I need to do is that I need to add
0:26
a watermark in the center of the video
0:29
so what I will show right here I've
0:31
given this command in the description of
0:32
this video so let me just show you both
0:36
the
0:37
commands so this is little bit
0:39
complicated command because we are we
0:41
will be using some complex filters for
0:43
this so let me just paste this command
0:46
and then explain to you what is
0:48
happening
0:49
so first of all let me show you this
0:52
command here
0:55
so once I execute this command you will
0:57
see this watermark will be added in the
1:00
center of the video so you can see the
1:03
command is executing it and after
1:09
executing so just wait for it to
1:18
finish so now you can see the command is
1:21
finished if I try to open the output
1:24
video you will
1:26
see the watermark text which is in
1:29
coding this
1:31
is exactly added in the center of the
1:33
screen as a watermark and it is
1:36
appearing in yellow color you can even
1:38
manipulate which font that you want to
1:40
use you can even change the color as
1:42
well and you can even change the size of
1:44
the text as well such as watermark you
1:47
can even control the opacity as well so
1:49
it's a very useful command because you
1:51
don't need to use any kind of video
1:53
editor for this you can easily execute
1:55
this command if you are having ffmppg
1:58
installed so let's suppose if I want to
2:00
change the
2:02
color using this command i can easily
2:05
manipulate all these factors so let me
2:08
first of all summarize you what this
2:10
command does so ffmpg- i this is your
2:13
input file input.mpp4 MP4 and then we
2:16
are applying a series of video filters -
2:19
VF and then first in double quotes we
2:23
are drawing the text here draw text is
2:25
equal to we are providing the font file
2:28
so I am using the built-in font inside
2:31
my system C windows fonts consola TTF
2:36
you can even use a custom font as well
2:38
and then we are providing the watermark
2:40
text which is coding six and then the
2:42
font size font color is equal to yellow
2:46
font size
2:48
72 we are also providing this box you
2:51
can see
2:53
that and then we are not re-encoding the
2:56
video so we are copying the encoding
2:58
settings and this is your output file so
3:01
now let me change some factors here uh
3:05
let me change the to 7 96 the phone size
3:10
let me change uh the color to blue
3:13
instead of yellow and uh let me change
3:15
the watermark text
3:18
to sample
3:21
watermark so I change
3:24
this let me replace
3:30
also the input file which
3:36
is 1.mpp4
3:46
so so now it is executing it so after
3:51
executing it
3:54
will actually add a watermark text right
3:57
in the center of the screen having the
4:00
blue
4:04
color so it is completed here you will
4:07
see that uh hello
4:10
guys as you can see the watermark is
4:13
successfully added so this is really
4:15
useful command guys because if you have
4:18
a series of videos that you need to add
4:20
some kind of watermark then this command
4:22
will be really useful i also have the
4:24
second version of this command which
4:27
essentially add some shadow as well so
4:30
if you want to add some shadow you can
4:32
use this command
4:34
let me also execute this one as well
4:36
just to show you what this command
4:43
does so I have given all these commands
4:46
in the description of this video so you
4:48
can copy
4:52
this so just wait the command is
4:55
executing and
5:04
uh so you can also see the speed of
5:07
conversion is also very great it doesn't
5:10
take too much time and you can
5:13
see if I now open
5:16
this it also adds some nice little
5:18
shadow as well you can see that so thank
5:22
you very much for watching this video
5:23
and also check out my website
5:26
freemediattools.com which contains
5:28
thousands of tools
#Multimedia Software
#Online Video
#Programming