Giter Club home page Giter Club logo

Comments (5)

Zulko avatar Zulko commented on May 16, 2024

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:

import moviepy.conf as mpy_conf
mpy_conf.change_settings({'FFMPEG_BINARY': my_custom_path,
                'IMAGEMAGICK_BINARY':my_other_custom_path})

You could make a personal configuration file my_conf.py like that:

FFMPEG_BINARY= my_custom_path
IMAGEMAGICK_BINARY = my_other_custom_path
#etc...

and you would use it like this:

conf.change_settings(file="path/to/my_conf.py")

Then there will also be a get_setting function which will be used everywhere where the configuration values are needed, like you suggested with get_ffmpeg_binary, so that errors will be raised at write_video time if for instance FFMPEG wasn't found and wasn't set manually.

I just need some time to ensure that the error messages stay informative in all cases.

from moviepy.

bobatsar avatar bobatsar commented on May 16, 2024

Hi Zulko,

yes that sounds good for me.
I don't understand why one would need additionally the my_conf.py variant but perhaps @sanfx knows a usage scenario for that.

Thanks for the great work

from moviepy.

Zulko avatar Zulko commented on May 16, 2024

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.

from moviepy.

Zulko avatar Zulko commented on May 16, 2024

Done ! At least on Github, not yet on PyPi. See the new moviepy/config_defaults.py for the details.

from moviepy.

PlanPh avatar PlanPh commented on May 16, 2024

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".
my start-code:
import os
import moviepy.config as mpy_conf
mpy_conf.FFMPEG_BINARY = os.path.join("C:\Program Files (x86)\ImageMagick-6.9.0-Q16", "ffmpeg", "ffmpeg.exe")
from moviepy.editor import VideoFileClip, ImageSequenceClip

Is their any else to consider? What could be wrong?

from moviepy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.