question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Imageio's new use of imageio-ffmpeg

See original GitHub issue

edit: 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:closed
  • Created 5 years ago
  • Reactions:8
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
Zulkocommented, Feb 13, 2019

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.

0reactions
Cinerarcommented, Feb 28, 2019

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.'

Read more comments on GitHub >

github_iconTop Results From Across the Web

imageio/imageio-ffmpeg: FFMPEG wrapper for Python - GitHub
This library is used as the basis for the imageio ffmpeg plugin, but it can also be used by itself. Imageio provides a...
Read more >
imageio-ffmpeg - PyPI
FFMPEG wrapper for Python. ... pip install imageio-ffmpeg. Copy PIP instructions. Latest version. Released: Apr 14, 2022. FFMPEG wrapper for Python ...
Read more >
imageio.plugins.ffmpeg
The ffmpeg format provides reading and writing for a wide range of movie formats such as .avi, .mpeg, .mp4, etc. as well as...
Read more >
How to use the imageio.plugins.ffmpeg function in ... - Snyk
How to use the imageio.plugins.ffmpeg function in imageio. To help you get started, we've selected a few imageio examples, based on popular ways...
Read more >
imageio.ffmpeg.download() has been deprecated. Use 'pip ...
I already tried to install the latest version of moviepy with conda install -c conda-forge moviepy . I also tried to install with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found