spdl.io.VideoEncoder

class VideoEncoder[source]

Video encoder.

Returned by Muxer.add_encode_stream().

Methods

encode(frames)

Encode video frames.

flush()

Notify the encoder of the end of the stream and fetch the buffered packets.

encode(frames: VideoFrames) VideoPackets | None[source]

Encode video frames.

Parameters:

frames – Audio frames. Use create_reference_video_frame() to convert tensor/array objects into frames.

Returns:

Packets objects if encoder generates one.

flush() VideoPackets | None[source]

Notify the encoder of the end of the stream and fetch the buffered packets.