You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I realize there have been updates since the writing of the article, but was wondering if I was just possibly doing something wrong, or if the write_gif functionality isn't working / has some dependencies I am unaware of.
Thanks for any help
from moviepy.editor import *
clip = (VideoFileClip("frozen_trailer.mp4").subclip((1, 22.65), (1, 23.2)).resize(0.3))
TypeError Traceback (most recent call last)
<ipython-input-3-822a7eb596ad> in <module>()
----> 1 clip.write_gif("small_gif.mp4")
<decorator-gen-170> in write_gif(self, filename, fps, program, opt, fuzz, verbose, loop, dispose, colors, tempfiles)
/Library/Python/2.7/site-packages/moviepy/decorators.pyc in requires_duration(f, clip, *a, **k)
52 raise ValueError("Attribute 'duration' not set")
53 else:
---> 54 return f(clip, *a, **k)
55
56
<decorator-gen-169> in write_gif(self, filename, fps, program, opt, fuzz, verbose, loop, dispose, colors, tempfiles)
/Library/Python/2.7/site-packages/moviepy/decorators.pyc in convert_masks_to_RGB(f, clip, *a, **k)
20 if clip.ismask:
21 clip = clip.to_RGB()
---> 22 return f(clip, *a, **k)
23
24 @decorator.decorator
/Library/Python/2.7/site-packages/moviepy/video/VideoClip.pyc in write_gif(self, filename, fps, program, opt, fuzz, verbose, loop, dispose, colors, tempfiles)
460 if program == 'imageio':
461 write_gif_with_image_io(self, filename, fps=fps, opt=opt, loop=loop,
--> 462 verbose=verbose, colors=colors)
463
464 elif tempfiles:
/Library/Python/2.7/site-packages/moviepy/video/io/gif_writers.py in write_gif_with_image_io(clip, filename, fps, opt, loop, colors, verbose)
283 quantizer = 'wu' if opt!= 'nq' else 'nq'
284 writer = imageio.save(filename, duration=1.0/fps,
--> 285 quantizer=quantizer, palettesize=colors)
286
287 verbose_print(verbose, "\n[MoviePy] Building file %s with imageio\n"%filename)
/Library/Python/2.7/site-packages/imageio/core/functions.pyc in get_writer(uri, format, mode, **kwargs)
150
151 # Return its writer object
--> 152 return format.get_writer(request)
153
154
/Library/Python/2.7/site-packages/imageio/core/format.pyc in get_writer(self, request)
169 raise RuntimeError('Format %s cannot write in mode %r' %
170 (self.name, select_mode))
--> 171 return self.Writer(self, request)
172
173 def can_read(self, request):
/Library/Python/2.7/site-packages/imageio/core/format.pyc in __init__(self, format, request)
205 self._request = request
206 # Open the reader/writer
--> 207 self._open(**self.request.kwargs.copy())
208
209 @property
TypeError: _open() got an unexpected keyword argument 'duration'
The text was updated successfully, but these errors were encountered:
from moviepy.editor import VideoFileClip
clip = VideoFileClip(media_path).subclip(
t_start=1, # time in seconds
t_end=3
).resize(.40)
clip.write_gif('test.gif')
Hey Guys,
I'm trying to follow the first part of the tutorial here http://zulko.github.io/blog/2014/01/23/making-animated-gifs-from-video-files-with-python/ but can't seem to get it working.
I realize there have been updates since the writing of the article, but was wondering if I was just possibly doing something wrong, or if the write_gif functionality isn't working / has some dependencies I am unaware of.
Thanks for any help
The text was updated successfully, but these errors were encountered: