GPUVideoEncoder#

class gs_nyx.nyx_py_video_encoder.GPUVideoEncoder#

Bases: object

GPU video encoder. Consumes CUDA frame buffers and produces compressed bitstreams on the CPU.

Constructors

GPUVideoEncoder()

Construct an uninitialized encoder; call ‘startup’ before use.

Methods

encode_frame_srgb_to_cpu

Encode one sRGB frame located at 'input_cuda_ptr' (CUDA device pointer) and write the bitstream to 'output_cpu_ptr' (host pointer).

force_next_frame_as_idr

Force the next encoded frame to be an IDR (instantaneous decoder refresh) keyframe.

max_buffer_size

Return the size in bytes of the largest CPU output buffer the encoder may produce for a single frame.

next_frame_is_idr

Return True if the next encoded frame will be an IDR frame (either scheduled by GOP or forced).

set_encoding_parameters

Update the target bitrate (bits per second) and frame rate of the encoder at runtime.

shutdown

Release all encoder, CUDA-interop and SDK global resources.

startup

Initialize the encoder with the given VideoEncoderStartupParams, retain the requested CUDA device, and load shipped resources.