I have a question for those who are familiar with the zoom feature of moviepy.
I want to make a video that zooms to a specific point in a photo, but I cannot achieve this.
If I simply use zoom, it will zoom towards the center of the photo, right?
Instead, I would like to zoom to the right side of the photo, or to the bottom, etc.
I ran the following code and now it zooms to the upper left corner of the photo instead of the center.
zoomRation = 0.04
screensize = (1920,1080)
clipPic1 = ImageClip('Image.png').set_position(("center","center")).set_duration(5)
clipPic1 = clipPic1.resize(screensize)
clipPic1 = clipPic1.set_position(lambda t : (t * 3 ,0)) #3 is a sample.
clipPic1 = clipPic1.resize(lambda t : 1 + zoomRation * t)
comsite1 = CompositeVideoClip([clipPic1],size=screensize)
finalClip = concatenate_videoclips([comsite1],method="compose")
finalClip.write_videofile("final.mp4",fps=10)
However, setting the 3 in the sample to -3 also zooms the image to the upper left corner. Also, the entire photo is moved to the right and a black background appears on the left side of the screen.
伊藤豪規 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.