imageio / imageio-ffmpeg

FFMPEG wrapper for Python
BSD 2-Clause "Simplified" License
225 stars 50 forks source link

What if a user wants to bring her/his own ffmpeg? #9

Closed almarklein closed 5 years ago

almarklein commented 5 years ago

Thoughts?

djhoese commented 5 years ago

If you assume people don't use binaries outside of their conda environments (safest for compatibility IMO) then is there any need to have --nodeps for the conda installation. For the pip installation, I could see this being desired and I guess the --no-binary flag is a good enough workaround.

I'm a little worried about the 2.5.0 conda package right now because, unless I'm misunderstanding, it is in a broken state for anyone who wants to use ffmpeg with it, right?

almarklein commented 5 years ago

there any need to have --nodeps for the conda installation.

True, but at least ppl could use that if they really wanted :)

... it is in a broken state for anyone who wants to use ffmpeg with it, right?

Well, users would have to use pip to install imageio-ffmpeg for now, which is not ideal. I can see if some would call it broken.

To be honest, I had not though about the conda package too much yet. I was mostly happy that this piece of work (which took me much longer than I planned) was done. In hindsight it would probably have been better to make an imageio-ffmpeg package before publishing the imageio 2.5.0 package.

djhoese commented 5 years ago

Well, users would have to use pip to install imageio-ffmpeg for now, which is not ideal. I can see if some would call it broken.

I call it broken because I now have to special case all of my environments that use imageio with ffmpeg which is all of my uses of imageio.

almarklein commented 5 years ago

I'm sorry for the inconvenience caused by my premature release of the imageio conda package. I'll try to make a conda feedstock for imageio-ffmpeg asap.

almarklein commented 5 years ago

https://github.com/conda-forge/staged-recipes/pull/7730

peircej commented 5 years ago

Yes this a bit annoying for us at psychopy - all our test suite just failed because it uses conda python and imageio with ffmpeg.

I do appreciate the packaging of ffmpeg as a wheel though (psychopy users found it annoying that it was only downloaded in a 2nd stage).

If I understand correctly though, imageio-ffmpeg is now a strict dependency? Wouldn't it be reasonable that if ffmpeg exists on the system then it could be used as a fallback? Then you don't need to build conda-forge imageio-ffmpeg but just use the existing conda ffmpeg?

Or is there something important about the version of ffmpeg you're using?

almarklein commented 5 years ago

The imageio-ffmpeg is an optional dependency for imageio. But it's required to use the ffmpeg plugin. The reason is that this library also includes the low-level wrapper.

djhoese commented 5 years ago

@peircej it is also important to note that on conda/conda-forge the imageio-ffmpeg package will be depending on the conda-forge version of ffmpeg (unless I'm misunderstanding).

peircej commented 5 years ago

OK, cool. I guess we can pin our test suite to use imageio==2.4.1 until this is resolved on conda-forge. Thanks

almarklein commented 5 years ago

FYI imageio-ffmpeg is now available in the conda-forge channel. As mentioned earlier, it is a noarch package (does not include the binaries) but depends on the ffmpeg conda package.

almarklein commented 5 years ago

Documented the behavior in the readme.

jtskowronek commented 3 months ago

Is this mic still on? @almarklein or others, can you point me in the right direction?:

I installed ffmpeg from source for my macbook m2 because I read all over that this is the "only" way to bypass the h.264 codec limitations I'm hitting in macos. But when installing moviepy, conda won't use the ffmpeg [release version] I installed, which I also symlinked to all relevant directories (site-packages, etc.) just for safe measure--I can use ffmpeg in terminal from all linked locations.

almarklein commented 3 months ago

Hi @jtskowronek, would the IMAGEIO_FFMPEG_EXE env var work in your case?

jtskowronek commented 3 months ago

IMAGEIO_FFMPEG_EXE

@almarklein thanks for the reply. No luck with IMAGEIO_FFMPEG_EXE or FFMPEG_BINARY. I put both env vars in my .zshrc, so they're loaded whenever any terminal is loaded [in macos Ventura]. Besides, it seems those env vars are only relevant for an installed version of imageio or whatever else (e.g. moviepy) is using ffmpeg, but I can't even install those without also installing a new ffmpeg.

At first I thought maybe my issue was caused by installing ffmpeg 7.0, since those python packages want 6.1.1. But then I realized my opencv build isn't even recognizing the ffmpeg I setup before building opencv. It seems I'll have to rebuild opencv again with ffmpeg somehow included in the build, and get back to you if that solves it.