sleap.io.videowriter#
Module for writing avi/mp4 videos.
Usage:
> writer = VideoWriter.safe_builder(filename, height, width, fps)
> writer.add_frame(img)
> writer.close()
- class sleap.io.videowriter.VideoWriter(filename, height, width, fps)[source]#
Abstract base class for writing avi/mp4 videos.
- class sleap.io.videowriter.VideoWriterImageio(filename, height, width, fps, crf: int = 21, preset: str = 'superfast')[source]#
Writes video using imageio as a wrapper for ffmpeg.
- filename#
Path to video file to save to.
- height#
Height of movie frames.
- width#
Width of movie frames.
- fps#
Playback framerate to save at.
- crf#
Compression rate factor to control lossiness of video. Values go from 2 to 32, with numbers in the 18 to 30 range being most common. Lower values mean less compressed/higher quality.
- preset#
Name of the libx264 preset to use (default: “superfast”).