-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zoom effect trembling #183
Comments
I think it's simply because you video is very low-resolution, in videos of higher resolution you don't see so much shaking. One solution could be to work on super-sized clips:
Hopefully this will give you the same result with less trembling. |
That solution worked perfectly! Here is a mwe: #!/usr/bin/env/ python
# -*- coding: utf-8 -*-
import os
from moviepy.editor import *
dir = os.path.split(os.path.realpath(__file__))[0]
img = os.path.join(dir, 'test.jpg')
out = os.path.join(dir, 'test-zoom.mp4')
screensize = (640,360)
clip = (ImageClip(img)
.resize(height=screensize[1]*4)
.resize(lambda t : 1+0.02*t)
.set_position(('center', 'center'))
.set_duration(10)
)
clip = CompositeVideoClip([clip]).resize(width=screensize[0])
vid = CompositeVideoClip([clip.set_position(('center', 'center'))],
size=screensize)
vid.write_videofile(out, fps=24) which led to the folowing result, without noticeable trembling: https://vid.me/A4dr Thank you! |
Great, closing this one. |
Hi, this is a good solution but I need to scale it from a very small image at centre to full screen image. 4x scaling does not improve it much . If I do 10x scaling , memory requirement & rendering time is too much for HD video. Is there any another way , something like vector graphics ? |
A minor change in lambda time will make your zoom effect smoother, try tweaking
|
Hello! I don't know if this may be an issue or bad coding from my side.
I was trying to concatenate some pictures with a slow zoom-in effect, but the results were not the expected. The resulting zoom effect was shaky at different speeds.
Here is an example code:
OS: Win7 x32.
Here is the resulting video: https://vid.me/vdwW
Here, the picture used: http://oi61.tinypic.com/503979.jpg
How can this be corrected?
This module is amazing! Big thanks!
The text was updated successfully, but these errors were encountered: