GPUVideoEncoder#

class gs_nyx.nyx_py_video_encoder.GPUVideoEncoder#

Bases: object

GPU video encoder. Consumes frames written in its exported input buffer and produces compressed bitstreams on the CPU.

Constructors

GPUVideoEncoder()

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

Methods

device_identity

Identity of the GPU the encoder runs on (DeviceIdentity), to pick the compute device sitting on the same GPU.

encode_frame_srgb_to_cpu

Encode the sRGB frame currently in the input buffer (wait for the compute write first) and write the bitstream to 'output_cpu_ptr' (host pointer).

export_input_buffer

Export the input buffer as an ExportedGraphicsBuffer, or None when the encoder is not started.

external_memory_handle_type

Kind of OS handle 'export_input_buffer' returns on this graphics API and platform (EExternalMemoryHandleType).

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 and SDK global resources.

startup

Initialize the encoder with the given VideoEncoderStartupParams and load shipped resources.