Skip to content

Find ffmpeg in frozen applications #5

Closed

Description

@almarklein

When this lib is included in a frozen application, the ffmpeg executable must be shipped along too. We should:

  • Perhaps provide a simple function that can be used in the freeze script to copy the ffmpeg exe.
  • Make 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.

Activity

  1. almarklein commented on Feb 5, 2019

    @almarklein
    MemberAuthor
  2. paulmueller commented on Feb 5, 2019

    @paulmueller
    Contributor

    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?

  3. almarklein commented on Feb 5, 2019

    @almarklein
    MemberAuthor

    Yeah the imageio_download_bin will no longer work for ffmpeg. So to summarize:

    • This new imageio_ffmpeg library will have the ffmpeg exe included in its "binaries" subdirectory. That is, on the platforms for which there are wheels.
    • We'd need to add a hook to PyInstaller, quite similar to the one you linked, I suppose.
    • We might need to add a little code in the get_ffmpeg_exe() function to look in alternative places when frozen?

    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.

  4. paulmueller commented on Feb 5, 2019

    @paulmueller
    Contributor

    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.

  5. almarklein commented on Feb 5, 2019

    @almarklein
    MemberAuthor

    That would be great!

  6. marnunez commented on Jun 1, 2021

    @marnunez

    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.

  7. paulmueller commented on Mar 14, 2022

    @paulmueller
    Contributor

    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?

  8. almarklein commented on Mar 15, 2022

    @almarklein
    MemberAuthor

    I guess so, but this has not yet been confirmed.

  9. paulmueller commented on Mar 15, 2022

    @paulmueller
    Contributor

    For me it works fine on Windows. Currently there is only imageio/imageio#766 in the way.

  10. paulmueller commented on Mar 15, 2022

    @paulmueller
    Contributor

    It also works on linux. I think this one can be closed.

  11. almarklein commented on Mar 15, 2022

    @almarklein
    MemberAuthor

    Thanks for the confirmation, we can close!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions