3

I need to zoom to a special point of an image. What do i have to change in this existing Script for example Y:81% X:27%?

 ffmpeg -r 25 -i image.jpg -vf 
"zoompan=z='zoom+0.001':x='if(gte(zoom,1.5),x,x+1)':y='y':d=125\"
 -y -shortest -c:v libx264 output.mp4 -y

Image Example

fixer1234
  • 28,064
S. Kr.
  • 143

1 Answers1

5

Use

ffmpeg -i image.jpg \
       -vf "zoompan=z='min(zoom+0.01,2.5)':x='iw/2-iw*(1/2-27/100)*on/150-iw/zoom/2':y='ih/2-ih*(1/2-81/100)*on/150-ih/zoom/2':d=150" \
       -c:v libx264 output.mp4 -y

150 is the duration of the zoom (and the movie), and it zooms from the centre to the target point. zoompan won't generate smooth motion if the animation is short, so consider increasing the length.

Gyan
  • 38,955