Reputation: 403
How can i add two watermark on a ffmpeg video at different different location. Can someone suggest me how can add two watermarks on the same video?
Following is my command:-
cmd = " -i "+VideoPathonSdCard+" -i "+ImagePath+" -metadata:s:v rotate=0 -filter_complex vflip,transpose=0,overlay=(W-w)/2:(H-h)/2,drawtext=fontsize="+TextSize+":fontfile=/system/fonts/DroidSans.ttf:fontcolor="+hexColor+":text="+ Constants.enStr(Text.trim())+":x="+x+":y="+y+"+40 -y -preset ultrafast -strict -2 "+VideoAfterEdit_Path;
Upvotes: 2
Views: 2829
Reputation: 134223
Use two overlay filters:
ffmpeg -i video0 -i image1 -i image2 -filter_complex \
"[0:v][1:v]overlay=25:(H-h)/2[bkg]; \
[bkg][2:v]overlay=100:75" \
-c:a copy output.mp4
If you want to resize the images add scale filter:
ffmpeg -i video0 -i image1 -i image2 -filter_complex \
"[1:v]scale=90:-1[img1]; \
[2:v]scale=iw/2:-1[img2]; \
[0:v][img1]overlay=25:(H-h)/2[bkg]; \
[bkg][img2]overlay=100:75" \
-c:a copy output.mp4
Upvotes: 8