Closed almarklein closed 2 years ago
This relates to https://github.com/imageio/imageio/issues/271 cc @paulmueller
I think this is already implemented. Simply use the --package-dir
option and the ffmpeg binary will be downloaded to the package directory / resources.
imageio_download_bin --package-dir ffmpeg
For PyInstaller, at least, the following built-in hook makes sure the binaries end up in the final distribution build: https://github.com/pyinstaller/pyinstaller/blob/develop/PyInstaller/hooks/hook-imageio.py
I experienced no problems with this approach.
reference: https://github.com/ZELLMECHANIK-DRESDEN/ShapeOut/blob/master/appveyor.yml#L82
[EDIT] I just realized that you intend to move the ffmpeg binary into the binary wheel. Still, the same applies. It should work if you migrate the original code from the imageio plugin. BTW: What about source tarballs on PyPI? Will they also contain the binary?
Yeah the imageio_download_bin
will no longer work for ffmpeg. So to summarize:
What about source tarballs on PyPI? Will they also contain the binary?
No, only the wheels. And there will still be a tarball on Pypi, so you can (surely pip has a flag for that?) install the lib without the binary, and supply one yourself.
I will create a PR for the hook and let you know how things work out. I believe that there will be no problem, if we use pgk_resources
.
That would be great!
Just a reminder, mostly for my future self, for when I inevitably forget it: those who installed imageio-ffmpeg with conda have no ffmpeg binary under the "resources" folder. Modify the hook or use pip instead of conda.
Sorry for replying just now. I did a quick check and it looks like this is already implemented with pkg_resources
. So it should work. Doesn't it?
I guess so, but this has not yet been confirmed.
For me it works fine on Windows. Currently there is only https://github.com/imageio/imageio/issues/766 in the way.
It also works on linux. I think this one can be closed.
Thanks for the confirmation, we can close!
When this lib is included in a frozen application, the ffmpeg executable must be shipped along too. We should:
get_ffmpeg_exe()
look in the frozen application directory.While we don't have this, please copy the ffmpeg executable yourself, and use the
IMAGEIO_FFMPEG_EXE
environment variable to point to it.