PHP FFMPEG Script to Add Text & Image Watermark in Video at Different Locations in Browser
Dec 21, 2025
Buy the full source code of the application here:
https://procodestore.com/index.php/product/php-ffmpeg-script-to-add-text-image-watermark-in-video-at-different-locations-in-browser/
Show More Show Less View Video Transcript
0:04
Uh hello guys, in this video I will be
0:06
talking about a PHP script where we will
0:10
be adding watermark to our videos. We
0:13
can add text watermark and we can even
0:16
add image watermark as well. So both the
0:19
scenarios I will be showing you guys.
0:20
This is first of all the text watermark
0:23
and both the scripts we will be writing
0:26
using ffmppg library which is an
0:28
open-source library for audio and video
0:30
processing. So this is a live demo guys
0:33
we are using bootstrap for the front-
0:36
end interface. So this application is
0:38
running in the browser itself. You will
0:40
see that we have a option of selecting a
0:42
video file. So this is let me select
0:45
this video file. Let me open this. This
0:47
is a simple video
0:49
15-second video. You can take any video
0:52
of your choice. Let me select this
0:54
video. Extension is MP4. And uh after
0:58
that
1:00
we need to basically add a text
1:02
watermark. So let's suppose I write any
1:05
text here
1:07
my own channel name. So after that we
1:11
have some options. We can increase the
1:13
size of the text. Let's suppose I change
1:15
it to 70. And then we have also the
1:17
color of the text. You can change to any
1:20
color of your choice.
1:22
Let me change it to this uh blue color
1:27
like this. And then we have position
1:30
guys. So basically here we have
1:33
different positions out there. Top left,
1:36
top right, bottom left, bottom right and
1:39
center. Let me choose center position.
1:41
Center position. And now if I click this
1:44
button right here. So what should this
1:47
PHP script will do? It will execute the
1:49
ffmpg command in the background. And now
1:52
you can see that our file has been
1:54
downloaded. If I play this file, you
1:57
will see that the watermark text has
2:00
been successfully added in the center of
2:02
the video. You can see that. So in this
2:05
way guys, you have seen videos uh
2:08
softwares doing the same thing. the paid
2:10
softwares if you want to add a
2:12
watermark. So you not don't need to
2:15
purchase paid softwares you can do this
2:17
uh simple video editing using this PHP
2:19
script using ffmpg so you can change the
2:23
color accordingly you can change this to
2:26
green color and this time let me choose
2:28
top left position and click add text
2:31
watermark. So this is really simple
2:33
guys. You can see how easy it is from a
2:36
just a button click you will be able to
2:38
add watermarks. So now you will see the
2:41
watermark is appearing in the left
2:43
position top left position
2:46
and I can change to top right. So this
2:49
time the water watermark will appear on
2:52
top right position.
2:54
So any position you will take you will
2:56
see.
3:00
So these are some of the preset
3:01
positions where you need to add the
3:03
watermark. That's why we have added it
3:05
inside the select box. If I se select
3:08
bottom left, it will basically
3:10
automatically calculate the commands
3:12
which are necessary for executing ffmpg.
3:16
So now you will see that the bottom mark
3:19
is added at the bottom left position of
3:21
this video. You will see that.
3:26
And uh next we have is the bottom right.
3:30
And let me adjust my web camera so that
3:33
you can see. And uh if I now click add
3:37
text watermark. So now you will see the
3:39
watermark text will be appeared in the
3:42
uh bottom right corner of the screen.
3:46
So now you can see that.
3:50
So basically guys you can customize your
3:53
watermark text if you want to do that.
3:55
And this is very simple. I will be
3:57
providing all the scripts, all the code
4:00
that you will need for this application.
4:01
The link is given in the description. If
4:04
you want this source code, you can go to
4:06
the description and you after payment
4:08
you will get this directory structure
4:11
where you will get all the files which
4:13
are necessary. Now let me show you the
4:14
demo of image.php.
4:17
I basically developed this library to
4:20
communicate with FMPPG and write these
4:22
software with my own hard work. That's
4:24
why I'm charging some money for it. And
4:27
now, same goes for the image watermark.
4:29
You need to select the video first of
4:31
all. And then you need to now select
4:33
your watermark image. So now we will
4:36
select our watermark image guys. So
4:38
let's suppose I select this image. This
4:41
is a simple YouTube logo. A transparent
4:46
YouTube logo out out there. If I select
4:48
this logo and now if I select here top
4:51
left corner of the screen, click apply.
4:54
watermark. It will again take some time
4:57
and after that it will make add the
4:59
logo.
5:01
You can see that it added the logo at
5:03
the top left position of the screen.
5:08
Now if I change this position to top
5:10
right. So now the image will appear in
5:13
the top right position of the screen in
5:15
the video.
5:19
You can see that.
5:23
And now if I basically select bottom
5:25
left now it will be appearing in the
5:27
bottom left position.
5:29
So with a simple click of a button guys
5:32
you will see
5:35
bottom left you can see that
5:40
now if I click bottom right for this I
5:43
need to adjust my web camera. So let me
5:45
adjust it.
5:48
So now if I open it
5:52
you will see that. So this is uh the
5:54
thing guys. And now lastly if I select
5:57
center
5:59
and uh
6:03
you will see that the file is
6:04
downloaded.
6:06
So now at the center of the screen the
6:08
logo is appearing.
6:11
So basically guys automatically it
6:13
calculates all the code that I have
6:16
written in these PHP scripts. It
6:17
automatically calculates the command
6:19
which are necessary and uh if you need
6:23
this source code guys I will highly
6:25
recommend you go to stripe.com after you
6:27
make the payment you will get the
6:29
directory structure that you are needed.
6:31
So these two PHP files are there right
6:33
here. It contains basic uh PHP code. You
6:37
will see that we are declaring variables
6:39
out there and basic HTML code is there.
6:42
So we are using the CDN or bootstrap to
6:44
basically
6:46
uh create this interface and then we for
6:49
same goes for the image watermark as
6:51
well. So you can see that. So we are
6:53
executing the f ofmppg commands and uh
6:57
after you purchase it you will if you
7:00
want to deploy this tool guys on
7:02
internet let's suppose various websites
7:04
do the same thing you can rank on Google
7:07
and earn a lot of money as well. If you
7:09
just search here apply
7:12
watermark on video.
7:15
So you will see lot of tools are already
7:18
built on this topic. So you can even
7:20
build your own tool and deploy it on
7:22
your own website as well. So you just
7:25
will need a basic hosting plan which
7:27
will support virtual private server VPS
7:30
hosting you will need so that you can
7:32
install FFmpG on it and make your own
7:34
tool. So if you basically have any sort
7:37
of question guys, you can ask in the
7:39
comment section. So this was the PHP
7:41
script FMPG script that I wanted to show
7:44
you guys to add image and text watermark
7:47
inside the videos. So if you like this
7:49
video, please hit that like button,
7:51
subscribe the channel, and if you want
7:53
this source code, you can go to the
7:54
description to purchase the full source
7:56
code. So thank you very much guys for
7:58
watching this live stream.
