act.utils.generate_movie#

act.utils.generate_movie(images, write_filename=None, fps=10, duration=None, **kwargs)[source]#

Creates a movie from a list of images or convert movie to different type

Parameters:
  • images (list, PosixPath generator, path to a directory, single string/PosixPath to movie) – List of images in the correct order to make into a movie or a generator from a pathlib.Path.glob() search. If a path to directory will create movie from all files in that directory in alpanumeric order. If a single file to a movie will allow for converting to new format defined by file extension of write_filename.

  • write_filename (str, pathlib.Path, None) – Movie output filename. Default is ‘movie.mp4’ in current directory. If a path to a directory that does not exist, will create the directory path.

  • fps (int) – Frames per second. Passed into moviepy->ImageSequenceClip() method

  • duration (float, int or None) – Converting mpg format can have issues with reading the duration of the movie. Set to number of seconds to override the derived value if the result is not what you expect.

  • **kwargs (dict) – Optional keywords passed into moviepy->write_videofile() method

Returns:

write_filename (str) – Full path name of created movie file