Reputation: 1548
I have an video and try to zoom out the entire content from 1.0 to 0.1, or literally, to a single point. I don't know the zoom value of it, so first I try to use 0.1 variant. It should decrease image 10x and fill with black background entire area outside the image.
I try with code:
ffmpeg -i e:/gals/1/logo_3s.mp4 -vf "scale=2560:2560,setsar=1:1,zoompan=z='if(lte(zoom,0.1),1.0,max(1.001,zoom-0.01))':d=1:x='(iw-(iw/zoom))/2':y='(ih-(ih/zoom))/2'" -s "1280x1280" -b:v 3000k -r 60 -t 3 e:/gals/1/loop_z.mp4
but nothing happens - only video is stretched but keeps right dimensions. it also looses some frames or without -t 3
extends from 3 to 7 seconds.
What I'm doing wrong? Maybe I could re-scale each frame by some ratio and make it progressively smaller?
Upvotes: 0
Views: 238
Reputation: 1084
using scale
ffmpeg -i 1280x720.mp4 -vf "
scale='if(gt(iw-n*20,1),iw-n*20,1)':-1:eval=frame,
pad=1280:720:-1:-1:eval=frame
" -crf 18 -c:a copy -t 3.14 -y /tmp/output.mp4
Upvotes: 0