Skip to content

After pyinstaller packages the program and copies the program to other devices, it prompts that the ffmepeg file cannot be found. #121

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

Open
jiongjiongJOJO opened this issue Jan 21, 2025 · 4 comments

Comments

@jiongjiongJOJO
Copy link

Image

  File "imageio/core/format.py", line 590, in append_data
  File "imageio/plugins/ffmpeg.py", line 587, in _append_data
  File "imageio/plugins/ffmpeg.py", line 648, in _initialize
  File "imageio_ffmpeg/_io.py", line 508, in write_frames
  File "imageio_ffmpeg/_io.py", line 124, in get_first_available_h264_encoder
  File "imageio_ffmpeg/_io.py", line 58, in get_compiled_h264_encoders
  File "imageio_ffmpeg/_utils.py", line 33, in get_ffmpeg_exe
RuntimeError: No ffmpeg exe could be found. Install ffmpeg on your system, or set the IMAGEIO_FFMPEG_EXE environment variable.

After investigation, the reason was not that ffmpeg could not be found. There was this file in the packaged directory. The reason was that after the program transferred the device, ffmpeg did not have permission and could not be called.

It is recommended to add code that grants writable permissions in the get_ffmpeg_exe function.

pyinstaller packaging instructions:

pyinstaller -D --contents-directory dist --collect-data imageio-ffmpeg -n "main" "main.py"
@almarklein
Copy link
Member

Yeah, this library does not have proper support for pyinstaller. If this is a problem, consider using pyav.

@jiongjiongJOJO
Copy link
Author

Yeah, this library does not have proper support for pyinstaller. If this is a problem, consider using pyav.

I still hope to be able to use imageio-ffmpeg and look forward to early optimization~

@almarklein
Copy link
Member

pyinstaller packaging instructions:
pyinstaller -D --contents-directory dist --collect-data imageio-ffmpeg -n "main" "main.py"

I'm not exactly sure what your request is. Do you mean that with the above, the permissions issue is resolved?

@jiongjiongJOJO
Copy link
Author

pyinstaller packaging instructions:
pyinstaller -D --contents-directory dist --collect-data imageio-ffmpeg -n "main" "main.py"

I'm not exactly sure what your request is. Do you mean that with the above, the permissions issue is resolved?

I mean, when you get the ffmpeg executable file, you can avoid this problem by adding executable rights to this file first.

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

2 participants