PyNvCodec.PySurfaceConverter

class PyNvCodec.PySurfaceConverter
__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: PyNvCodec._PyNvCodec.PySurfaceConverter, width: int, height: int, src_format: PyNvCodec._PyNvCodec.PixelFormat, dst_format: PyNvCodec._PyNvCodec.PixelFormat, gpu_id: int) -> None

    Constructor method.

    param width:

    target Surface width

    param height:

    target Surface height

    param src_format:

    input Surface pixel format

    param dst_format:

    output Surface pixel format

    param gpu_id:

    what GPU to run conversion on

  2. __init__(self: PyNvCodec._PyNvCodec.PySurfaceConverter, width: int, height: int, src_format: PyNvCodec._PyNvCodec.PixelFormat, dst_format: PyNvCodec._PyNvCodec.PixelFormat, context: int, stream: int) -> None

    Constructor method.

    param width:

    target Surface width

    param height:

    target Surface height

    param src_format:

    input Surface pixel format

    param dst_format:

    output Surface pixel format

    param context:

    CUDA context to use for conversion

    param stream:

    CUDA stream to use for conversion

Methods

Execute(self, src, cc_ctx)

Perform pixel format conversion.

Format(self)

Get pixel format.

__init__(*args, **kwargs)

Overloaded function.

Execute(self: PyNvCodec._PyNvCodec.PySurfaceConverter, src: VPF::Surface, cc_ctx: PyNvCodec._PyNvCodec.ColorspaceConversionContext) VPF::Surface

Perform pixel format conversion.

Parameters:
  • src – input Surface. Must be of same format class instance was created with.

  • cc_ctx – colorspace conversion context. Describes color space and color range used for conversion.

Returns:

Surface of pixel format equal to given to ctor

Return type:

PyNvCodec.Surface

Format(self: PyNvCodec._PyNvCodec.PySurfaceConverter) PyNvCodec._PyNvCodec.PixelFormat

Get pixel format.