deface
deface copied to clipboard
[macOS] Could not open file <file> as a video file with imageio
This is an issue I faced but was able to resolve by following a few steps documented below. Creating an issue here so that it can be documented by the owners somewhere if desired (or I can create a PR later with an FAQ section in the README if the owners prefer):
This is not an issue with the deface package, but rather the imageio
dependency. When running deface video.mp4
, I got the following error:
➜ deface video.mp4
Input: video.mp4
Output: video_anonymized.mp4
Could not open file video.mp4 as a video file with imageio. Skipping file...
OS: macOS Ventural 13.5.2 Chip: Apple M1 Pro Python Version: Python 3.11.5 Homebrew: 4.1.12
I was able to resolve this by doing 2 things:
- Uninstalling
librist
andmbeditis
because somehow they weren't found by imageio, and then re-installingffmpeg
(source)
➜ brew uninstall librist --ignore-dependencies
➜ brew uninstall mbedtls --ignore-dependencies
➜ brew reinstall ffmpeg
- Exporting the env variable because, for some reason,
imageio
expected env varIMAGEIO_FFMPEG_EXE
to be set to the ffmpeg path:
➜ export IMAGEIO_FFMPEG_EXE="/opt/homebrew/Cellar/ffmpeg/6.0.1/bin/ffmpeg"
(source)
After this, running deface
worked for me as expected. Thanks for creating this! (Result here)