-
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
Setting conf.py ffmpeg path on the fly from python #66
Comments
Thanks for the insight. I didn't know you could change the content of "conf" at run time, this is really nice. @bobatsar @sanfx would the following implementation be ok for you ? It should work like this:
You could make a personal configuration file
and you would use it like this:
Then there will also be a I just need some time to ensure that the error messages stay informative in all cases. |
Hi Zulko, yes that sounds good for me. Thanks for the great work |
Ok, that will be done. The advantage of using my_conf.py is that if the program gets big with many parameters in the configuration, then some user will have a favorite configuration file that they can use in all of their script. It's common practice with matplotlib, where you ca define a "stylesheet" for all your plots which is actually a configuration file. |
Done ! At least on Github, not yet on PyPi. See the new moviepy/config_defaults.py for the details. |
Dear guys, i tried to implement your solutions for this issue. But it wont work for me. I got the "[Error 2] The system cannot find the file specified". Is their any else to consider? What could be wrong? |
Hi there,
at the moment it is not possible to modify the
FFMPEG_BINARY
orIMAGEMAGICK_BINARY
from a running python environment. The only way to modify it is to hardcode it in the conf.py or set the PATH environment to let it find the binaries automaitcally.The problem ist when trying to bundle an application with cx_freeze as Win32Gui (without console) app. In that case os.environ["PATH"] is ignored and the binaries can not be found. If bundled as a console app, the binaries can be found by appending the ffmpeg path to os.environ["PATH"].
The problem is, that conf.py can not be loaded and modified if ffmpeg can not be found.
A possible soultion would be not to raise the IOError.
Then it is possible to import first only moviepy.conf and modify it on the fly:
All calls to moviepy after setting the path now work.
Additionally there could be a function to get the FFMPEG path for other moviepy modules.
See also the pull request from @sanfx with the xml config which has the same target to not hardcode the ffmpeg paths.
The text was updated successfully, but these errors were encountered: