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

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

Open
mmahmad opened this issue Sep 24, 2023 · 0 comments
Open

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

mmahmad opened this issue Sep 24, 2023 · 0 comments

Comments

@mmahmad
Copy link

mmahmad commented Sep 24, 2023

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)

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

No branches or pull requests

1 participant