- PyAVPlugin.write_frame(frame: ndarray, *, pixel_format: str = 'rgb24') None [source]#
Add a frame to the video stream.
This function appends a new frame to the video. It assumes that the stream previously has been initialized. I.e.,
init_video_streamhas to be called before calling this function for the write to succeed.
The image to be appended/written to the video stream.
The colorspace (pixel format) of the incoming frame.
Frames may be held in a buffer, e.g., by the filter pipeline used during writing or by FFMPEG to batch them prior to encoding. Make sure to
.close()the plugin or to use a context manager to ensure that all frames are written to the ImageResource.