AK47
AK47

Reputation: 45

FFMPEG images to video + overlay video

I am trying to make 15 second video where the background layer is a video made up of 2 images, the first line creates a 15 second video from 2 images.

I chose a small framerate so it renders an mp4 quickly. I then overlay a webm video (which has transparency) over the images. The final video seems to keep the framerate of 2, but i would rather keep the 24 framerate of the webm video.

Is this possible? & is it also possible to turn the below into 1 statement.

ffmpeg -loop 1 -framerate 2 -t 11 -i image1.png -loop 1 -framerate 2 -t 4 -i image2.png -filter_complex "[0][1]concat=n=2" backgroundvideo.mp4;
ffmpeg -i backgroundvideo.mp4 -c:v libvpx-vp9 -i overlayvideo.webm -filter_complex overlay newvid.mp4

Upvotes: 3

Views: 575

Answers (1)

oguz ismail
oguz ismail

Reputation: 50815

You can use the filter fps to adjust your background's framerate

ffmpeg \
  -loop 1 -framerate 2 -t 11 -i image1.png \
  -loop 1 -framerate 2 -t 4  -i image2.png \
  -c:v libvpx-vp9 -i overlayvideo.webm \
  -filter_complex '[0][1]concat,fps=24[bg];[2][bg]overlay' \
backgroundvideo.mp4

Upvotes: 2

Related Questions