VideoPlot#

class prose.blocks.visualization.VideoPlot(plot_function, destination, fps=10, compression=None, width=None, name=None)[source]#

A block to create a video from a matploltib plot (using ffmpeg).

Parameters:
  • plot_function (callable) – A function that takes an image as input and produce a plot.

  • destination (str) – The path to save the resulting video.

  • fps (int, optional) – The frames per second of the resulting video. Default is 10.

  • compression (int, optional) – The compression rate of the resulting video (-cr value of fmmpeg). Default is None.

  • width (int, optional) – The width in pixels of the resulting video. Default is None (i.e. original image size).

  • name (str, optional) – The name of the block. Default is None.

citations#

The citations for the block.

Type:

list of str

run(image)[source]#

Adds a plot to the video.

terminate()[source]#

Closes the video writer.