Sreehari Kodavalam
Sreehari Kodavalam

Reputation: 23

FFMPEG How to add gif water mark to mp4 video with loop,scale,overlay positionig

This is my code

ffmpeg -i video.mp4  -i anim.gif -filter_complex "[1:v] loop=-1,scale=300:-1 [ol], [0:v] [ol] overlay=W-w:H-h-10" -codec:a copy -y out.mp4

But am unable to put it in loop the gif according to video length

Am also trying to scale the gif width to 30% of th main video width Gif positioing working here am able to position the gif at the bootom right corner But i also need to scale it according to main video width

Upvotes: 0

Views: 472

Answers (1)

add -ignore_loop 0 to gif input:

ffmpeg -i video.mp4 -ignore_loop 0 -i anim.gif -filter_complex "
[1:v][0:v]scale2ref=w=iw*0.3:h=ow*mdar [ol][bg];
[bg][ol] overlay=W-w:H-h-10:eof_action=pass
" -shortest -c:a copy -y out.mp4

use scale2ref for 30% scale of input video

Upvotes: 1

Related Questions