FFmpeg Documents Single Image to Video | Add-text | Credits

FFmpeg-Documents-Home

Fade Image/Overlay in a Video

Fade an image into a video starting at ten seconds take 2 seconds to complete.
Fade out at 20 seconds take 3 seconds to completely fade out.

EXAMPLE

ffmpeg -framerate 2 -i use/%03d.png -c:v libx264 -r 30 -pix_fmt yuv420p vids/vid-from-images.mp4
ffmpeg -loop 1 -i credit.jpg -c:v libx264 -t 10 -pix_fmt yuv420p -vf scale=1280:720 credit.mp4
         

Zoom in a Video

Zoom in a video
Zoom 1.5 ( zoom,1.5 ) times over period of 700 ( d=700 )

ffmpeg -i vids/short.mp4 \
-vf "zoompan=z='zoom+0.001':x='if(gte(zoom,1.5),x,x-1)':y='y':d=700" \
-c:a copy -t 30 vids/ZOOM.mp4	

Simple Overlay Without Sound

ffmpeg -i vids/ZOOM.mp4 -i small.png -filter_complex \
'overlay[out]' -map '[out]' vids/zoom-small.mp4	

Simple Sliding Overlay Without Sound

Simple Sliding Overlay Without Sound ( The black and white words is the image )
Slide an image across a video - start after 5 seconds end at 20 seconds.
between=(t,5,20)
Simple Sliding Image

ffmpeg -i vids/short.mp4 -i small.png -filter_complex \
"[0:v][1:v]overlay=enable='between=(t,5,20)':x=120+t*28:y=t*10[out]" \
-map "[out]" vids/imageslide.mp4	

Sliding a Text Image From Right to Left

Sliding a Text Image From Right to Left ( The image is below )
Slide the text image across a video - start after 3 seconds end at 30 seconds.
between=(t,3,30)
Start location 1220 (x=1220) with each step of t move left 60px (x=1220-t*60).
Set y axis at 50px (y=50[out])
Slding Text Image

ffmpeg -i vids/short.mp4 -i scrolling-text.png -filter_complex \
"[0:v][1:v]overlay=enable='between=(t,3,30)':x=1220-t*60:y=50[out]" \
-map "[out]" vids/imagescroll.mp4

rotates an overlay

Spin an Overlay On a Video

Spin an Overlay On a Video ( The image is below )
Crteate an increasing t variable overlay=enable='between=(t,30,31)
between=(t,3,30)
Start location 1220 (x=1220) with each step of t move left 60px (x=1220-t*60).
Set y axis at 50px (y=50[out])
Slding Text Image

NOTE :
iw : input width
ih : input height

ffmpeg -i vids/short.mp4 -i arrow.png -filter_complex \
"[1:v]overlay=enable='between=(t,30,31)', \
rotate=30*PI*t/180:c=none:ow=rotw(iw):oh=roth(ih), \
scale=300:-1[rotate];[0:v][rotate] overlay=640:360[out]" \
-map [out] -t 29 vids/spin5a.mp4

ffmpeg -i vids/short.mp4 -i small.png -filter_complex "[1:v]overlay=enable='between=(t,30,31)', rotate=30*PI*t/180:c=none:ow=rotw(iw):oh=roth(ih), scale=300:-1[rotate];[0:v][rotate] overlay=640:360[out]" -map [out] -t 29 spin5a.mp4


ffmpeg -i vids/short.mp4 -i small.png -filter_complex "[1:v]overlay=enable='between=(t,30,30)', rotate=30*PI*t/180:c=none:ow=rotw(iw):oh=roth(ih),scale=300:-1[rotate];[0:v][rotate] overlay=640:360[out]" -map [out] -t 29 spin5.mp4


ffmpeg -i vids/short.mp4 -i small.png -filter_complex \
"[1:v]overlay=enable='between=(t,3,10)' rotate=30*PI/180:c=none:ow=rotw(iw):oh=roth(ih),scale=300:-1[rotate];[0:v][rotate] \
overlay=40:10[out]" -map [out] spin.mp4


ffmpeg -i vids/short.mp4 -i small.png -filter_complex "[1:v]overlay=enable='between=(t,3,30)', rotate=30*PI*t/180:c=none:ow=rotw(iw):oh=roth(ih),scale=300:-1[rotate];[0:v][rotate] overlay=40:10[out]" -map [out] spin3.mp4

ffmpeg -i vids/short.mp4 -i small.png -filter_complex "[0:v][1:v]overlay=enable='between=(t,3,30)', rotate=30*PI*t/180:c=none:ow=rotw(iw):oh=roth(ih),scale=300:-1[rotate];[0:v][rotate] overlay=40:10[out]" -map [out] spin4.mp4