spdl.io.video_encode_config¶
- video_encode_config(*, height: int, width: int, frame_rate: tuple[int, int] | None = None, pix_fmt: str = 'rgb24', bit_rate: int = -1, compression_level: int = -1, qscale: int = -1, gop_size: int = -1, max_b_frames: int = -1, colorspace: str | None = None, color_primaries: str | None = None, color_trc: str | None = None) VideoEncodeConfig [source]¶
Customize encoding behavior.
- Parameters:
height (int) – The size of the image to encode.
width (int) – The size of the image to encode.
frame_rate – Optional The frame rate. If not provided, the default value of encoder is used.
pix_fmt (str) – Optional The pixel format of the input frames. The default
"rgb24"
is for RGB array in NHWC format. If using format that is more suitable for video production like"yuv420p"
, the frame data must be converted to the target format before it is fed to encoder.bit_rate (int) – Optional Override bit rate.
compression_level (int) – Optional Override compression level.
sqcale (int) – Optional Override scale.
gop_size (int) – Optional Override GOP size.
max_bframes (int) – Optional Override maximum number of B-Frames.
colorspace (str) –
Optional Override the color space, color primaries, and color transftransformation characteristics (color linearization function). An example value is
"bt709"
.color_primmaries (str) –
Optional Override the color space, color primaries, and color transftransformation characteristics (color linearization function). An example value is
"bt709"
.color_trc (str) –
Optional Override the color space, color primaries, and color transftransformation characteristics (color linearization function). An example value is
"bt709"
.