After pyinstaller packages the program and copies the program to other devices, it prompts that the ffmepeg file cannot be found.
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"
Yeah, this library does not have proper support for pyinstaller. If this is a problem, consider using pyav.
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~
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?
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.
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.
Try to set the executable permission. If it cannot be set, throw an exception. If it can be set, set it before proceeding.