Using ffmpeg for Overlays
I wanted to jazz up my video of just me speaking with an image and video overlays on top of the original source video.
Step 1.
Record your video with some nice empty space to one side of you:
Step 2.
Add your static image logo to upper left corner:
ffmpeg -i sun_talk.mov -i noegotribes.png -filter_complex "[0:v][1:v] overlay=25:25:enable='between(t,0,200)'" -pix_fmt yuv420p -c:a copy sun_talk_with_logo.mov
I got noegotribes.png from noegotribes.com
25:25 means x,y cooridnates of where to place the logo.
between 0, 200 means the entire length of my video since it’s 200 seconds long.
Step 3.
Add some video to lower left corner. The site spaceweathernews.com has some great videos of the sun.
ffmpeg -i sun_talk_with_logo.mov -i sun.mov -filter_complex "[0:v][1:v] overlay=25:200:enable='between(t,0,200)'" -pix_fmt yuv420p -c:a copy sun_talk_with_logo_and_video.mov
Notice now the 25:25 changed to 25:200
200 y means move it down. And as a happy accident the length of my sun.mov happened to be just a little less than the length of my source video. Watch the ending of the video and notice the sun disappear at exactly the right moment!
You can see the final result here on youtube.
Happy ffmpeg’ing everyone.