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

Опубликовано: 24 Октябрь 2022
на канале: 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
ꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷꟷ


Смотрите видео How to overlay a picture on a video | Add a photo on a film VFX онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь The FFMPEG guy 24 Октябрь 2022, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 498 раз и оно понравилось 20 людям.