ORB-HD / deface

Video anonymization by face detection
MIT License
685 stars 95 forks source link

[macOS] Could not open file <file> as a video file with imageio #50

Open mmahmad opened 1 year ago

mmahmad commented 1 year ago

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:

  1. Uninstalling librist and mbeditis because somehow they weren't found by imageio, and then re-installing ffmpeg (source)
➜ brew uninstall librist --ignore-dependencies
➜ brew uninstall mbedtls --ignore-dependencies
➜ brew reinstall ffmpeg
  1. Exporting the env variable because, for some reason, imageio expected env var IMAGEIO_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)

Cloning4659 commented 3 months ago

i had to use pip to uninstall and install deface after the last step to get it working.