Quantcast
Channel: MediaSPIP
Viewing all articles
Browse latest Browse all 118022

FFMPEG Image to video zoompan starting position

$
0
0

In creating mp4 slideshows out of images, I've taken some examples online for zoompan, but I still haven't quite grasped how to make them start from a certain location in an image. Here's the typical command:

ffmpeg -i image-000.jpg -filter_complex "color=c=black:r=60:s=1920x1080[demo];[0:v]format=pix_fmts=yuva420p,scale=8000:-1,zoompan=z='min(zoom+0.0005,1.2)':s=2000x1333:d=360:x='if(gte(zoom,0.9),x,x+1/a)':y='if(gte(zoom,0.9),y,y+1)',fade=in:0:25:alpha=1,setpts=PTS-STARTPTS+0.0/TB[v0];[demo][v0]overlay=format=yuv420" -t 6 -c:v libx264 -y out000.mp4

Photos I use are typically 3x2 or 4x3 in aspect ratio, so I get that they'd have to be cut off somewhere in a 16x9 video. The thing with the above code (and many other "Ken Burns effect" samples) is that they start with the bottom portion of the images cut off, then either zoom in more or zoom out, never showing the bottom.

How do I get the animation to start further down on the image? Nothing I do in the y='...' section affects it. Not even putting in constant numbers between 0 and 100000 instead of adjusting values in that formula y='if(gte(zoom,0.9),y,y+1)'.

Note: I've had some success using crop or pad for the original image, but I'd rather understand how to better position zoompan inside of the image.


Viewing all articles
Browse latest Browse all 118022


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>