Imageio's new use of imageio-ffmpeg
See original GitHub issueedit: hit the wrong key and posted this before it was done.
Hi there,
I meant to post an issue for a heads-up about the new situation, but I guess I forgot. So here it is. I realize that the change means some “upstream pain”, but it was needed to keep imageio managable.
In short
Imageio previously had you download the ffmpeg executables using a function or a CLI command. This behavior has changed. Instead, using imageio’s ffmpeg plugin now requires the new imagio-ffmpeg library. This library contains a low-level ffmpeg wrapper, and ships the ffmpeg binaries via platform specific wheels.
Background
(You can skip over this) The reason for the change is that the strategy with the explicit download was clumsy, and more importantly a security hazard. Combined with the fact that about 50% of imageio’s incoming issues were related to ffmpeg, I decided to spin the ffmpeg bit out. We also considered other ffmpeg wrappers, but distribution remains hard, so I decided on a solution that ships the exes in the platform specific wheels. The (low level) wrapper should also be more stable (e.g. wrt terminating ffmpeg subprocesses), and can be improved upon by people who care about ffmpeg more easily.
What to do (for Moviepy and its users)
Dependencies
The eventual solution should be to add a dependency on imageio-ffmpeg, but I could not put myself to write py27 compatible code in 2019, so as noted above, imageio-ffmpeg is py3k only. I guess that Moviepy will drop 2.7 support somewhere this year? Ah, I just saw that you pinned imageio to <2.5.0 for older Python versions. That should do it.
… deprecate their old versions, meaning that they may point to deprecated URLs to download ffmpeg
The binaries will stay up for the old versions of imageio. At some point I removed some older ones (matching a 1.5 year old imageio version), but these are restored.
The platform specific wheels do not work on all platforms
The platform-specific wheels are, well, platform-specific, so some platforms will just install the tarfile (some Linuxes). Also, some platforms may install the wheel, but the ffmpeg exe may not work (e.g. Windows XP).
Also see the corresponding issue. In short, I suspect that the platform does not match manulinux2010_x86_64, which is a consequence of the platform that the (new) ffmpeg exes were build on. The solution is to document that Linux users (that don’t use a “modern desktop Linux”) may want to use:
$ pip install imageio-ffmpeg --no-binary
$ apt-get install ffmpeg # or equivalent
Other needed changes?
@Zulko It would be good to have a look at these release notes. The main part, other than what you know now, may be that the wrapper no longer attempts to guess the number of frames from the fps and duration. The reader object has a method to get an exact count, but its slow (so we can’t use it by default).
I am not sure if Moviepy uses other imageio functionality, but it may be worth considering using imageio-ffmpeg directly. Note though, that support for webcams, seeking, and looping, is still implemented by the ffmpeg plugin.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:8
- Comments:11 (7 by maintainers)

Top Related StackOverflow Question
Thanks so much for writing this, it helps me wrap my head around the issue.
I believe this supports my impression that I have solved the problem in moviepy and that all is left is to push to PyPI (and document the marginal linux case).
Great work on imageio and imageio-ffmpeg btw.
I believe this is the reason why Dockerfile fail to build with
Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/local/lib/python3.7/site-packages/imageio/plugins/ffmpeg.py", line 40, in download "imageio.ffmpeg.download() has been deprecated. " RuntimeError: imageio.ffmpeg.download() has been deprecated. Use 'pip install imageio-ffmpeg' instead.'