Exemple #1
0
 def Export(self, filename, duration=0.1, repeat=True, **kwargs):
     """ Export(self, filename, duration=0.1, repeat=True, **kwargs)
     
     Export recorded movie to either:
       * a series of images
       * an animated GIF 
       * an SWF (shockwave flash) file
       * an AVI file
     
     See vv.movieWrite for more information.
     
     """
     frames = self.GetFrames()
     vv.movieWrite(filename, frames, duration, repeat, **kwargs)
Exemple #2
0
 def Export(self, filename, duration=0.1, repeat=True, **kwargs):
     """ Export(self, filename, duration=0.1, repeat=True, **kwargs)
     
     Export recorded movie to either:
       * a series of images
       * an animated GIF 
       * an SWF (shockwave flash) file
       * an AVI file
     
     See vv.movieWrite for more information.
     
     """
     frames = self.GetFrames()
     vv.movieWrite(filename, frames, duration, repeat, **kwargs)
Exemple #3
0
 def Export(self, filename, duration=0.1, repeat=True, **kwargs):
     """ Export(self, filename, duration=0.1, repeat=True, **kwargs)
     
     Export recorded movie to either:
       * a series of images
       * an animated GIF
       * an SWF (shockwave flash) file
       * an AVI file
     
     See vv.movieWrite for more information.
     
     """
     frames = self.GetFrames()
     if filename.lower().endswith('.gif'):
         loop = 0 if repeat else 1
         vv.movieWrite(filename,
                       frames,
                       fps=1 / duration,
                       loop=loop,
                       **kwargs)
     else:
         vv.movieWrite(filename, frames, fps=1 / duration, **kwargs)
# -*- coding: utf-8 -*-
# Copyright (C) 2012, Almar Klein
#
# Visvis is distributed under the terms of the (new) BSD License.
# The full license can be found in 'license.txt'.

import visvis as vv

# Try importing imageio
imageio = None

try:
    import imageio
except ImportError:
    pass


def movieWrite(filename, images, *args, **kwargs):
    """ Proxy for imageio.mimwrite()
    """

    if imageio is None:
        raise RuntimeError("visvis.movieWrite requires the imageio package.")

    return imageio.mimwrite(filename, images, *args, **kwargs)


if __name__ == '__main__':
    ims = vv.movieRead('newtonscradle.gif')
    vv.movieWrite('newtonscradle.swf', ims)
Exemple #5
0
# -*- coding: utf-8 -*-
# Copyright (C) 2012, Almar Klein
#
# Visvis is distributed under the terms of the (new) BSD License.
# The full license can be found in 'license.txt'.

import visvis as vv
from visvis.vvmovie import movieWrite


if __name__ == "__main__":
    ims = vv.movieRead("newtonscradle.gif")
    vv.movieWrite("newtonscradle.swf", ims)