0

I am using ffmpeg (in linux server with php)

and I want to watermark a png logo on the mp4 file, my problem is that

I want to scale my logo and change it based on source video size(for example 1/4 of height),

I have this code bellow :

shell_exec('ffmpeg -i file.mp4 -i logo.png -filter_complex "overlay=10:10" file-watered.mp4");

it works on every video.

For Normal (medium) size image:

enter image description here

For Small (medium) size image (which is bad!)

enter image description here

Ideal output for this size would be:

enter image description here

I've changed a little bit my first code like this :

shell_exec('ffmpeg -i file.mp4 -i logo.png -filter_complex "[0:v]scale=500:-1[bg];[bg][1:v]overlay=(main_w-overlay_w):(main_h-overlay_h)" watered.mp4');

The main problem is that, I want to change the logo size based on video size.

How can I do it with ffmpeg ?

pocek
  • 53
  • 3

0 Answers0