Skip to content

fix: update moviepy crop import for v2 compatibility#193

Open
AdityaVikramSingh19 wants to merge 3 commits intoFujiwaraChoki:mainfrom
AdityaVikramSingh19:main
Open

fix: update moviepy crop import for v2 compatibility#193
AdityaVikramSingh19 wants to merge 3 commits intoFujiwaraChoki:mainfrom
AdityaVikramSingh19:main

Conversation

@AdityaVikramSingh19
Copy link
Copy Markdown

Problem

from moviepy.video.fx.all import crop throws a ModuleNotFoundError in moviepy v2 because the module structure changed.

Fix

Updated the import to from moviepy.video.fx import Crop as crop which works with moviepy v2.

Fixes #117

The old import `from moviepy.video.fx.all import crop` is broken in moviepy v2. Updated to `from moviepy.video.fx import Crop as crop` to fix the ModuleNotFoundError.
In moviepy v2, crop() can no longer be called as a standalone function.
Updated both crop() calls in combine() to use the new clip.with_effects([Crop(...)]) syntax.
- Replaced set_fps() with with_fps() for moviepy v2 compatibility
- Replaced .fx(afx.volumex, 0.1) with .with_effects([afx.MultiplyVolume(0.1)]) for moviepy v2 compatibility
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

Successfully merging this pull request may close these issues.

ModuleNotFoundError: No module named 'moviepy.video.fx.crop'

1 participant