Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ffmpeg overlay video on another

I have a very simple question about ffmpeg.

I need to put video2 on video1.

Like this photo : (with margin from top and left)

enter image description here

Video2 is 470*470 px

I need a simple command to do this.

Please tell me how can i get that result?

I've tried something like this :

ffmpeg -i 2.mp4 -vf "movie=blur.mp4:loop=200,scale=iw/2:-1"
like image 545
dodojoe Avatar asked Oct 14 '25 14:10

dodojoe


1 Answers

Use

ffmpeg -i 2.mp4 -vf "movie=blur.mp4:loop=200,scale=iw/2:-1[bg];[bg][0]overlay=LEFT:TOP:shortest=1" out.mp4

where LEFT and TOP are replaced with the respective margins.

like image 137
Gyan Avatar answered Oct 17 '25 08:10

Gyan