Simple GIF from zipped
While looking for Python image sequence to GIF, I stumbled into your moviepy module: http://zulko.github.io/blog/2014/01/23/making-animated-gifs-from-video-files-with-python/
I tested using MP4 and MOV seems to work perfectly.
However, rather than to create MOV using Quicktime or Blender each time, is there a simpler way to skip the video to GIF, but instead to work from ZIP or Folder Path, to get all the files in sequence and generate GIF?
Thanks!
use
clip = ImageSequenceClip(my_path, fps=20)
where my_path contains the images in the right order.
I keep getting this error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/jimmygunawan/anaconda/envs/py35/lib/python3.5/site-packages/moviepy/video/io/ImageSequenceClip.py", line 104, in **init**
if with_mask and (make_frame(0).shape[2]==4):
File "/Users/jimmygunawan/anaconda/envs/py35/lib/python3.5/site-packages/moviepy/video/io/ImageSequenceClip.py", line 99, in make_frame
self.lastimage = imread(self.sequence[index])[:,:,:3]
File "/Users/jimmygunawan/anaconda/envs/py35/lib/python3.5/site-packages/imageio/core/functions.py", line 181, in imread
reader = read(uri, format, 'i', **kwargs)
File "/Users/jimmygunawan/anaconda/envs/py35/lib/python3.5/site-packages/imageio/core/functions.py", line 108, in get_reader
'in mode %r' % mode)
ValueError: Could not find a format to read the specified file in mode 'i'
Wonder that's because the image sequences are PNGs output from Blender?
Linking this to #219, which is about the same error.
I'm having this problem too, and it's been more than one year since this issue is first addressed, is anyone maintaining moviepy?
Can you explain what your problem is ? are you also using Blender ?
My apologizes, after some debugging I realized the problem does not lie in moviepy.
I'm not sure whether this would help anybody, but here's the cause of my problem: I was calling imread() on a file that is not a picture.
here's my stack:
File "video.py", line 27, in <module>
main()
File "video.py", line 22, in main
clip = ImageSequenceClip(args.image_folder, fps=args.fps)
File "/root/miniconda3/envs/carnd/lib/python3.6/site-
packages/moviepy/video/io/ImageSequenceClip.py", line 106, in __init__
if with_mask and (imread(self.sequence[0]).shape[2]==4):
File "/root/miniconda3/envs/carnd/lib/python3.6/site-packages/imageio/core/functions.py", line
185, in imread
reader = read(uri, format, 'i', **kwargs)
File "/root/miniconda3/envs/carnd/lib/python3.6/site-packages/imageio/core/functions.py", line
108, in get_reader
'in mode %r' % mode)
ValueError: Could not find a format to read the specified file in mode 'i'
which resembles this line from @enzyme69 's call stack
self.lastimage = imread(self.sequence[index])[:,:,:3]
So I guess there may be a connection.
I was trying to make a video from pictures in a folder. I forgot there's a .DS_Store file automatically generated in that folder along with all the picture. This file got picked up by moviepy and caused the problem.
@enzyme69 Does the problem persist?
I'd say that this should be fixed. I suggest putting more checks in ImageSequenceClip to ensure that (particularly when passing in a folder name) no non-images are loaded. This can catch people out because sometimes there are hidden files (such as .DS_Store on Mac) that cause it to crash.
@tburrows13 can you assign this to me?