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

Update code and requirements to support Moviepy v2 #652

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

erfanasgari21
Copy link

Moviepy released version 2 on November 20, 2024, introducing major breaking changes. The current code installs Moviepy v2 due to the requirement moviepy>=1.0.3, but it fails to run because of incompatibilities with the new version. This PR updates the code to match the v2 naming and importing conventions and ensures compatibility by updating the requirements to moviepy>=2.0.0.


Changes Included:

  1. Updated Requirements:

    • Changed moviepy>=1.0.3 to moviepy>=2.0.0 to ensure users with older versions upgrade to v2.
  2. Code Migration to Moviepy v2:
    The following changes were made based on the official Moviepy v2 migration guide:

    • Simplified Imports:
      Replaced moviepy.editor imports with the new simplified syntax:
      from moviepy import VideoFileClip
    • Renamed Methods:
      Updated .set_ methods to .with_ as per the new API:
      clip.with_fps(...)  # Previously clip.set_fps(...)
    • Resize Method:
      Updated clip.resize() to clip.resized() to match the new signature:
      clip.resized(width=640)  # Previously clip.resize(width=640)

Testing:

  • Verified that the updated code runs without errors using Moviepy v2.
  • Ensured that all changes adhere to the official migration guide.

Additional Notes:

If you’re using an older version of Moviepy (v1), you’ll need to upgrade to v2 to use this updated code. The changes are minimal but necessary for 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.

1 participant