1

with a lot of searching on this board, I've been able to put the following ffmpeg command together. It creates a clip of an image scaling from 1.00 -> 1.12x over 240 frames @ 24p (10 seconds).

ffmpeg -loop 1 -i myphoto.jpg -vf \"zoompan=z='min(zoom+0.0005,1.12)':x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)':d=240\" -c:v libx264 -pix_fmt yuv420p -t 10 -s hd1080 -r 24 -crf 10 myvideo.mp4

However, when this command is ran, I get a 10 second clip, with the zoompan 'resetting' to 1.00x at around 9.5 seconds. Upon checking the rendered video in Quicktime's video inspector, I'm finding the FPS to equal 23.7, not the 24 I've set with -r 24. Am I looking over something here?

1 Answer 1

2

Images are treated as 25 fps unless specified, and the zoompan filter also has a private fps option that determines its output. So use,

ffmpeg -loop 1 -framerate 24 -i myphoto.jpg -vf \"zoompan=z='min(zoom+0.0005,1.12)':x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)':d=240:s=hd1080:fps=24\" -c:v libx264 -pix_fmt yuv420p -t 10 -crf 10 myvideo.mp4

(Also, zoompan has its own size option, so you should set that within the filter else there will be two scaling operations)

2
  • Thank you, but this doesn't seem to make much of a difference with the 'zoom out' back to 1.00x @ 9 sec,13 frames. Commented Jun 29, 2016 at 5:15
  • Corrected command
    – Gyan
    Commented Jun 29, 2016 at 5:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .