mmfutils.plot.animation
Tools for creating animations and movies.
- class mmfutils.plot.animation.MyFuncAnimation(*v, **kw)[source]
Bases:
FuncAnimationRefactoring of the FuncAnimation class to do the following:
Allowing user to store video when generating HTML video.
Allow clean stopping between frames in a NoInterupt context.
- to_html5_video(embed_limit=None, filename=None, extra_args=None)[source]
Convert the animation to an HTML5
<video>tag.This saves the animation as an h264 video, encoded in base64 directly into the HTML5 video tag. This respects
rcParams[“animation.writer”](default:'ffmpeg') andrcParams[“animation.bitrate”](default:-1). This also makes use of the interval to control the speed, and uses the repeat parameter to decide whether to loop.- Parameters:
embed_limit (float, optional) – Limit, in MB, of the returned animation. No animation is created if the limit is exceeded. Defaults to
rcParams[“animation.embed_limit”](default:20.0) = 20.0.filename (str, optional) – (New) If provided, save the movie in this file and keep it, otherwise the movie will be stored in a temporary directory and deleted after.
- Returns:
video_tag – An HTML5 video tag with the animation embedded as base64 encoded h264 video. If the embed_limit is exceeded, this returns the string “Video too large to embed.”
- Return type: