moviepy icon indicating copy to clipboard operation
moviepy copied to clipboard

Not compatible with M1 chip

Open vitalii-bulyzhyn opened this issue 2 years ago • 4 comments

Expected Behavior

Since mac with M1 has different architecture, path to ffmpeg should be /opt/homebrew/opt/ffmpeg

Actual Behavior

Now it's pointing to the /usr/bin and I get next error:

[Errno 2] No such file or directory: '/usr/bin/ffmpeg'

Steps to Reproduce the Problem

Specifications

  • Python Version: 3.9.15
  • Moviepy Version: 1.0.3
  • Platform Name: macOS
  • Platform Version: 12.0

vitalii-bulyzhyn avatar Nov 14 '22 22:11 vitalii-bulyzhyn

Thanks for this bug report! Based on issues submitted to other projects I've seen, compatibility problems with M1 seem quite widespread...

keikoro avatar Nov 29 '22 16:11 keikoro

@vitalii-bulyzhyn The real issue is that imageio_ffmpeg does not bundle ffmpeg for M1 macs: https://github.com/imageio/imageio-ffmpeg/issues/71

The easiest solution I found was to install ffmpeg (version 4.x) via brew and alias ffmpeg to it (or pass it via the env variable). Unfortunately, moviepy is not yet fully compatible with version 5.x (default for brew as of Dec 2022)

piotlinski avatar Dec 10 '22 14:12 piotlinski

@vitalii-bulyzhyn The real issue is that imageio_ffmpeg does not bundle ffmpeg for M1 macs: imageio/imageio-ffmpeg#71

The easiest solution I found was to install ffmpeg (version 4.x) via brew and alias ffmpeg to it (or pass it via the env variable). Unfortunately, moviepy is not yet fully compatible with version 5.x (default for brew as of Dec 2022)

Can confirm. Running moviepy on an M1. Just needed to brew install ffmpeg.

alairock avatar Feb 03 '23 18:02 alairock

In case anyone else is stuck with the same issue but already has the latest version of ffmpeg installed, here is what I did to debug and fix:

  1. Install ffmpeg version 4 with brew install ffmpeg@4
  2. Check that ffmpeg 4.4.4 (latest version for ffmpeg 4) is installed. Mine was installed at /opt/homebrew/Cellar/ffmpeg@4/4.4.4/bin/ffmpeg
  3. Create or add the following environment variable to your .env file
FFMPEG_BINARY="/opt/homebrew/Cellar/ffmpeg@4/4.4.4/bin/ffmpeg"
  1. Check that moviepy loads ffmpeg successfully with the following python script
from moviepy.config import *

if try_cmd([FFMPEG_BINARY])[0]:
    print( "MoviePy : ffmpeg successfully found." )
else:
    print( "MoviePy : can't find or access ffmpeg." )

flerovious avatar Oct 27 '23 08:10 flerovious