Skip to content
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

Add Environment Variable to overwrite FFMPEG_BINARY #237

Closed
dkarchmer opened this issue Dec 17, 2015 · 5 comments
Closed

Add Environment Variable to overwrite FFMPEG_BINARY #237

dkarchmer opened this issue Dec 17, 2015 · 5 comments

Comments

@dkarchmer
Copy link
Contributor

It would be great if I didn't have to manually install the package (rather than just use pip install) if I want to use my own version of ffmpeg.

One solution could be to check if there is an Environment Variable, and if so, use that instead of the defaults (export FFMPEG_BINARY=ffmpeg)

If this is an acceptable change, I may be willing to make it. Maybe something as simple as:

import os
FFMPEG_BINARY = os.getenv('FFMPEG_BINARY', 'ffmpeg-imageio')
IMAGEMAGICK_BINARY = os.getenv('FFMPEG_BINARY', 'auto-detect')
@Zulko
Copy link
Owner

Zulko commented Dec 17, 2015

Use this:

from moviepy.conf import change_settings
change_settings({"FFMPEG_BINARY": "ffmpeg"})

@Zulko Zulko closed this as completed Dec 17, 2015
@dkarchmer
Copy link
Contributor Author

Yes, but I don't want to require that on every one of my users.
I am creating a docker image with the latest ffmpeg and it is hard to use without been able to setup an environment variable.
Are you against using environment variables for any reason? I have a change ready to go. It should be transparent to everybody else.

@dkarchmer
Copy link
Contributor Author

See https://hub.docker.com/r/dkarchmervue/moviepy/~/dockerfile/ for what I am trying to do.
I have a workaround (see end of file) by getting manually getting the source, changing the config_defaults.py and then running python setup.py install but I will like to avoid having to manually edit your code as part of the docker image.

I hope you agree it would not be best practices to hard code the binary location in all my scripts, as it is not really best practice to custom build any library.

@Zulko
Copy link
Owner

Zulko commented Dec 17, 2015

Ok for a commit then.

@Zulko Zulko reopened this Dec 17, 2015
@dkarchmer
Copy link
Contributor Author

Pull request tracked with #238
Closing this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants