Skip to content

Problem importing imageio_ffmpeg in frozen applications #766

Closed

Description

@paulmueller

I see this issue with imageio 2.16.1
I don't see this issue with imageio 2.10.3

This might have been caused by bdbe699 (which appeared first in imageio 2.11).

For some reason imageio cannot import the imageio_ffmpeg module in frozen applications anymore.

This is the imageio-related traceback that I get:

  File "imageio\core\functions.py", line 98, in get_reader
  File "imageio\core\imopen.py", line 332, in imopen
ValueError: Could not find a backend to open `C:\Users\Paul\Downloads\fmt-tdms_fl-image-bright_2017\M4_0.040000ul_s_imaq.avi`` with iomode `r?`.
Based on the extension, the following plugins might add capable backends:
  FFMPEG:  pip install imageio[ffmpeg]

I checked an imageio_ffmpeg got bundled into the application.

Activity

  1. FirefoxMetzger commented on Mar 15, 2022

    @FirefoxMetzger
    Contributor

    Interesting. We recently added a section on freezing to the docs (thanks again @richardsheridan ). Did you account for what is written there? I.e., did you make sure that pyinstaller ends up including the ffmpeg plugin file? (Should be in imageio/plugins/ffmpeg.py)

  2. paulmueller commented on Mar 15, 2022

    @paulmueller
    ContributorAuthor

    No, I didn't. Why don't you add those plugins to the imageio pyinstaller hook? From the docs I understand they are light-weight, so I guess this would be the best choice.

  3. FirefoxMetzger commented on Mar 15, 2022

    @FirefoxMetzger
    Contributor

    Why don't you add those plugins to the imageio pyinstaller hook?

    Lack of knowledge from my side. If it's possible to add them automatically, I'm happy to have that added; however, I never used pyinstaller myself so I don't know what would be needed to accomplish that. I could - of course - spend the time and learn, but that time currently goes to other issues with higher priority.

    That said if you would like to submit a PR that adds this, I'm happy to review.

  4. paulmueller commented on Mar 15, 2022

    @paulmueller
    ContributorAuthor

    OK. I can do that. The PR would be with Pyinstaller. I will let you know here. Please keep this open in the meantime.

  5. paulmueller commented on Mar 15, 2022

    @paulmueller
    ContributorAuthor

    I created the PR for PyInstaller. It might make sense to update the docs section on freezing with a note that there are hooks for imageio (including plugins) and imageio_ffmpeg and everything that does not require any additional binaries should just work with pyinstaller-hooks-contrib version greater than 2022.2.

  6. FirefoxMetzger commented on Mar 15, 2022

    @FirefoxMetzger
    Contributor

    Thanks @paulmueller . I saw the PR and left two comments :) Once that is merged upstream I will make an update to our docs.

  7. paulmueller commented on Mar 15, 2022

    @paulmueller
    ContributorAuthor

    Thanks for your help. I think if the PR is merged in the current state, it should definitely be mentioned in the ImageIO docs that building an app with PyInstaller should be done in a clean Python environment with only the packages installed needed for the required plugins.

  8. richardsheridan commented on Mar 15, 2022

    @richardsheridan
    Contributor

    Thanks for picking this up, I had decided not to make the pyinstaller PR because I don't have any use cases for imageio_ffmpeg or others so I wouldn't have been able to tell if I really did it right 😅

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions