moviepy
moviepy copied to clipboard
Not compatible with M1 chip
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
Thanks for this bug report! Based on issues submitted to other projects I've seen, compatibility problems with M1 seem quite widespread...
@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)
@vitalii-bulyzhyn The real issue is that
imageio_ffmpeg
does not bundle ffmpeg for M1 macs: imageio/imageio-ffmpeg#71The 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.
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:
- Install ffmpeg version 4 with
brew install ffmpeg@4
- 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
- Create or add the following environment variable to your
.env
file
FFMPEG_BINARY="/opt/homebrew/Cellar/ffmpeg@4/4.4.4/bin/ffmpeg"
- 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." )