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

'to_gif' raises IOError/OSError when no 'program' parameter is given #43

Closed
tasinttttttt opened this issue Jun 8, 2014 · 8 comments
Closed

Comments

@tasinttttttt
Copy link
Contributor

Because the to_gif function uses the ImageMagick as default program to generate the gif. But when there's no ImageMagick, there is no fallback for ffmpeg.

I fixed it by manually changing the parameter to 'ffmpeg' (which is bad) but maybe the best thing would be to add a GIF_PROGRAM variable in the conf.py for people to choose from imagemagick or ffmpeg ?

@Zulko
Copy link
Owner

Zulko commented Jun 8, 2014

I am not sure I understand. If you have ffmpeg, you can do:

myclip.to_gif('animation.gif', fps=10, program='ffmpeg')

Doesn't this work ?

I have seen your other commits, I am not sure it is a good idea to have a global variable for the gif program. Most of the time, I use ImageMagick, but sometimes the result is not good, so I want to try with ffmpeg (they yield very different results).

@Zulko
Copy link
Owner

Zulko commented Jun 19, 2014

So does it work with the line I gave above ?

1 similar comment
@Zulko
Copy link
Owner

Zulko commented Jun 26, 2014

So does it work with the line I gave above ?

@sergiobuj
Copy link

I was also getting something like:

/usr/local/lib/python2.7/dist-packages/moviepy/tools.pyc in subprocess_call(cmd, verbose, errorprint)
     23     verboseprint( "\nMoviePy Running:\n>>> "+ " ".join(cmd) )
     24 
---> 25     proc = sp.Popen(cmd, stderr = sp.PIPE)
     26 
     27     out, err = proc.communicate() # proc.wait()
OSError: [Errno 2] No such file or directory

But adding the program='ffmpeg' parameter to to_gif worked for me.

@Zulko
Copy link
Owner

Zulko commented Jul 21, 2014

@sergiobuj This error means that the program cannot detect ImageMagick. Did you install ImageMagick ?

@sergiobuj
Copy link

I didn't install ImageMagick, but the extra parameter worked.
Is 'to_gif' one of the advanced features? because I didn't install Pygame either.

@Zulko
Copy link
Owner

Zulko commented Jul 21, 2014

The default parameter for "program" is "ImageMagick", and it will only work if ImageMagick is installed on your computer. If you change it to ffmpeg you can make gifs using ffmpeg (but these are generally heavy and ugly).

Pygame is not needed for gifs, it is needed if you want to make previews of your gifs/videos before writing them to a file, it is especially useful if you use the IPython Notebook.

Thanks for the feedback, I will make more explicit error messages for the "couldn't find imagemagick" case.

@sergiobuj
Copy link

Got it, thanks!
I will install ImageMagick (and Pygame) because the gifs really look ugly.

@Zulko Zulko closed this as completed Jul 28, 2014
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

3 participants