-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Packaging ffmpeg binary with moviepy #85
Comments
I asked Reddit and this here seems to answer the problem (enables to trigger events during installation). Looks not completely trivial and we must be careful not to force ffmpeg install on people that have an incompatible version and want to keep it. Another option would be an external script that you can run. For instance, after installing moviepy, you could run in a terminal
And that would install/upgrade ffmpeg. I would prefer this as a first approach. Honnestly it's not on the top of my prioreties and I have no idea how to handle Windows/MacOS so if you can come up with a standalone script that does that I'd gladly merge it. |
An alternative idea is to leverage bits of code from the Imageio package (imageio.readthedocs.org) for automatically downloading platform-specific binaries. The relevant functionality appears to be mostly contained in this file: https://github.com/imageio/imageio/blob/master/imageio/core/fetching.py. edit: Hey! I just looked over imageio in a bit more detail. They include ffmpeg as one of their binaries. I think they already solved why I was trying to describe. |
Imageio's solution looks good. But then, should we automatically install ffmpeg during moviepy's installation, without warning, or make a second script ? To go further, maybe we could automatize a little:
Another question is: where should the ffmpeg binary be placed by default on the user's system ? On linux, it would be in /usr/bin. On mac, I don't really know, maybe /usr/bin too or /usr/local/bin. On windows, I have no clue. That's my main problem, I can only implement/check a solution for Ubuntu 12.04 32bit :) I'm calling @almarklein into the discussion, he may have some ideas :) |
Here's some code to obtain the appdata dir for most platforms: https://github.com/imageio/imageio/blob/master/imageio/core/util.py#L364 |
Some further thoughts about when to download such dependencies: you can install at build-time (i.e. ship the binary in the dist package), install-time, or run-time. I've learned that install-time is apparently not recommended for users who work in an environment without an internet connection, and is frowned upon in the Debian build process. In imageio we have several of such dependencies, and I now try to find a way to ship the freeimage library at build-time, and have other binaries auto-dowloaded when needed (at runtime). |
@almarklein Thanks ! I'll look into it when I have time. Just to be sure I understand: when you build, you package different versions of imageio for different platforms, and send all these packages on PyPI, each with a different binary, is that right ? |
@Zulko Actually, I am still figuring out what to do (imageio/imageio#42). My idea was to create a wheel for each platform. In |
Ach, I have no experience at all with wheel or Python/C packaging. I didn't understand, is the C code yours, or is it for external software (e.g. ffmpeg) ? Because in this case you can surely ship the pre-compiled binary ? |
The C code is not mine. I mean that the problem is that it seems not possible to build platform specific pacakges (at least not with wheel), because wheel sees that the package is pure Python, and thus marks it as cross-platform. |
Fantastic. Will test soon.
|
This works very well for me, now. Thanks for this! Closing. |
Would be very convenient to have a "batteries included" install approach, where pip installing moviepy ensures you have some minimum version of ffmpeg. Would likely have to be platform specific.
Pre-built FFMPEG binary are available for every platform.
https://www.ffmpeg.org/download.html
The text was updated successfully, but these errors were encountered: