How to overlay a picture on a video | Add a photo on a film VFX

Published: 24 October 2022
on channel: The FFMPEG guy
498
20

Today, we show how to add a picture on a video using ffmpeg. This process can actually be used to overlay any types of photos (.jpg, .png, .gif) or image to a video. All parameters can be customized to suit your needs.
ꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷ
EXAMPLES
ꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷ
❶ Picture on top of a video. Default settings
→ ffmpeg -i input.mp4 -vf "movie=image.jpg [layer]; [in][layer] overlay [out]" output01.mp4

with:
-i input.mp4 = Reads file «input.mp4» and …
-vf "movie=image.jpg [layer] = … imports «image.jpg» calling it [layer].
[in][layer] = Loads, in order, the original video ([in]) and the layer ([layer])…
overlay = … and overlays both (last loaded on top)… Note: The upper left corner of the .jpg will be in position x=0, y=0 = upper left corner of the video
[out] = … calling the result [out].
output01.mp4 = Outputs finally the whole to file «output01.mp4»

❷ Picture on top of a video. Custom picture size
→ ffmpeg -i input.mp4 -vf "movie=image.jpg [layer]; [layer]scale=300:375 [layer2];[in][layer2] overlay [out]" output02.mp4

with:
-i input.mp4 = Reads file «input.mp4» and …
-vf "movie=image.jpg [layer] = … imports «image.jpg» calling it [layer].
[layer]scale=300:375 [layer2] = Resizes now [layer] to 300x375 calling the result [layer2]…
[in][layer2] overlay = … and overlays, as before, the resulting [layer2] on top of the original video [in]…
[out] = … calling the result [out].
output02.mp4 = Outputs finally the whole to file «output02.mp4»

❸ Picture on top of a video. Custom picture size. Custom picture position
→ ffmpeg -i input.mp4 -vf "movie=image.jpg [layer]; [layer]scale=400:500 [layer2];[in][layer2] overlay=300:200 [out]" output03.mp4

with:
-i input.mp4 = Reads file «input.mp4» and …
-vf "movie=image.jpg [layer] = … imports «image.jpg» calling it [layer].
[layer]scale=400:500 [layer2] = Resizes now [layer] to 400x500 calling the result [layer2]…
[in][layer2] overlay = … and overlays, as before, the resulting [layer2] on top of the original video [in]…
300:200 [out] = … at position x=300 & y=200, calling the result [out].
-output03.mp4 = Outputs finally the whole to file «output03.mp4»
ꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷ
→ Catch up with the FFMPEG guy Channel
   • ALL THE VIDEOS FROM THE CHANNEL  
ꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷ
MUSIC
ꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷ
→ Rev - Eveningland
ꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷ
An FFMPEG question?
Ask the FFMPEG guy
ꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷ


Watch video How to overlay a picture on a video | Add a photo on a film VFX online without registration, duration hours minute second in high quality. This video was added by user The FFMPEG guy 24 October 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 498 once and liked it 20 people.