Skip to content
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

A way to only zoom in one direction and to control the length/speed? #42

Open
Roemer opened this issue Jul 11, 2020 · 3 comments
Open

Comments

@Roemer
Copy link

Roemer commented Jul 11, 2020

Is there a way to control the zoom behavior, like if I only want to zoom in or zoom out and how fast the zoom should be?
Best for the zoom speed I found so far is the fltSteps by increasing the number of steps and modifying the framerate accordingly.

@bnlcas
Copy link

bnlcas commented May 5, 2022

Hey, I just implemented a basic version of this request locally.

In autozoom.py I made a flag for boomerang_clip = True
and changed the end of autozoom.py to reflect this option.

if boomerang_clip:
. frames = [ npyFrame[:, :, ::-1] for npyFrame in npyResult + list(reversed(npyResult))[1:] ]
else:
frames = [ npyFrame[:, :, ::-1] for npyFrame in npyResult ]
moviepy.editor.ImageSequenceClip(sequence = frames, fps=frame_rate).write_videofile(arguments_strOut)

To change the duration, I think the best way to go is to change the number of steps from the default 75 to a duration & frame rate defined by the user:
change
'fltSteps': numpy.linspace(0.0, 1.0, 75).tolist()
to
zoom_steps = int(zoom_duration * frame_rate)
'fltSteps': numpy.linspace(0.0, 1.0, zoom_steps).tolist(),

I would be happy to make a PR to add these changes into this repo. I could also have these features be reflected in the GUI if that helps.

@bnlcas
Copy link

bnlcas commented May 5, 2022

This:
https://github.com/bnlcas/3d-ken-burns/blob/add-boomerang-and-duration-controls/autozoom.py

@bnlcas
Copy link

bnlcas commented May 20, 2022

@sniklaus - just a follow up. I made a PR for this a few weeks back. Let me know if you would be ok with a merge or if there are any modifications you would like to see before accepting these changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants