2

I want to zoom a video into its center using ffmpeg (command line). I tried by using the zoompan filter, but it's using the first frame of the video only. I want the video to be played while zooming in. You can think of the desired effect as zooming in with the camera while filming. Did anyone achieve something like this with a single filter chain?

The only way i can currently think of is to extract every single frame of the video, scale it, crop it, save it, and encode all the images back to a video. But this is not really my preferred way. Any hints? Thanks in advance!

1 Answer 1

3

zoompan, by default, is set up to operate upon still images, but it can be made to operate upon videos.

Basic form is

zoompan=z=pzoom+0.01:x='iw/2-iw/zoom/2':y='ih/2-ih/zoom/2':d=1:s=1280x720:fps=30

pzoom is the final zoom value for the previous frame. d is no. of instances for each frame of the stream.

2
  • 2
    Typo. Corrected.
    – Gyan
    Commented Mar 6, 2019 at 17:10
  • 1
    awesome! tried it, now it works like a charm! thanks a lot! :)
    – dy_
    Commented Mar 6, 2019 at 17:12

You must log in to answer this question.

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