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:
For Small (medium) size image (which is bad!)
Ideal output for this size would be:
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 ?