Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- from PIL import Image, ImageSequence
- import sys, os
- filename = sys.argv[1]
- im = Image.open(filename)
- original_duration = im.info['duration']
- frames = [frame.copy() for frame in ImageSequence.Iterator(im)]
- frames.reverse()
- from images2gif import writeGif
- writeGif("reverse_" + os.path.basename(filename), frames, duration=original_duration/1000.0, dither=0)
- #load your frames
- frames = ...
- #create a video writer
- writer = cvCreateVideoWriter(filename, -1, fps, frame_size, is_color=1)
- #and write your frames in a loop if you want
- cvWriteFrame(writer, frames[i])
- import os
- os.system("mencoder ...")
Add Comment
Please, Sign In to add comment