fmpeg -filter_complex move image

Install ffmpeg on Mac OS X using Homebrew:

➜  ~ brew install ffmpeg

ffmpeg Documentation

https://ffmpeg.org/ffmpeg.html

Test video and image

➜  blog ffmpeg -i Wildlife.flv

Image move from bottom to top in videos

➜  blog ffmpeg -i Wildlife.flv -i img.png -filter_complex  "[0:v][1:v]overlay=enable='between=(t,0,200)':x=600:y=728-10*t*10[out]" -map "[out]" output_1.mp4

GIF preview

Video with image in the middle

➜  blog ffmpeg -i Wildlife.flv -i img.png -filter_complex "[1]scale=50:50[b];[0][b] overlay=(W-w)/2:(H-h)/2:enable='between(t,0,20)'" -pix_fmt yuv420p -c:a copy output_3.mp4

Start zooming in the middle of the picture

➜  blog ffmpeg -framerate 25 -loop 1 -i IMG_5379.jpg -filter_complex "[0:v]scale=4032x3024,zoompan=z='min(zoom+0.0025,1.5)':x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)':d=125,trim=duration=5[v]" -map "[v]" -y output_5.mp4DDD
  • test image
  • GIF preview

#Reference

https://superuser.com/questions/1112617/ffmpeg-smooth-zoompan-with-no-jiggle

Using ffmpeg video to GIF

  • Convert video to GIF
➜  blog ffmpeg -i Wildlife.flv Wildlife.gif
  • Convert part of the video to GIF
➜  blog ffmpeg -t 5 -ss 00:00:01 -i output_1.mp4 output_1.gif

Add a Comment

Your email address will not be published.