imageio.plugins.pyav.PyAVPlugin.write
- PyAVPlugin.write(ndimage: Union[ndarray, List[ndarray]], *, codec: Optional[str] = None, is_batch: bool = , , , , ,
Save a ndimage as a video.
Given a batch of frames (stacked along the first axis) or a list of frames, encode them and add the result to the ImageResource.
The ndimage to encode and write to the ImageResource.
The codec to use when encoding frames. Only needed on first write and ignored on subsequent writes.
If True (default), the ndimage is a batch of images, otherwise it is a single image. This parameter has no effect on lists of ndimages.
The resulting videos frames per second.
The pixel format of the incoming ndarray. Defaults to “rgb24” and can be any stridable pix_fmt supported by FFmpeg.
The pixel format to use while encoding frames. If None (default) use the codec’s default.
If not None, apply the given sequence of FFmpeg filters to each ndimage. Check the (module-level) plugin docs for details and examples.
If not None, apply the given graph of FFmpeg filters to each ndimage. The graph is given as a tuple of two dicts. The first dict contains a (named) set of nodes, and the second dict contains a set of edges between nodes of the previous dict. Check the (module-level) plugin docs for details and examples.
If the chosen ImageResource is the special target "<bytes>" then
write will return a byte string containing the encoded image data.
Otherwise, it returns None.
When writing <bytes>, the video is finalized immediately after the
first write call and calling write multiple times to append frames is
not possible.