python_vali.PyNvJpegEncoder¶
- class python_vali.PyNvJpegEncoder¶
- __init__(self: python_vali._python_vali.PyNvJpegEncoder, gpu_id: int) None ¶
Constructor method.
- Parameters:
gpu_id – what GPU to run encode on
Methods
Context
(self, compression, pixel_format)NvJpegEncodeContext structure contains state and parameters of PyNvJpegEncoder, including given compression coefficient (100 = maximum quality) and PixelFormat.
Run
(self, context, surfaces)Encode multiple Surfaces.
__init__
(self, gpu_id)Constructor method.
- Context(self: python_vali._python_vali.PyNvJpegEncoder, compression: int, pixel_format: python_vali._python_vali.PixelFormat) python_vali._python_vali.NvJpegEncodeContext ¶
NvJpegEncodeContext structure contains state and parameters of PyNvJpegEncoder, including given compression coefficient (100 = maximum quality) and PixelFormat. Using one context in multiple threads is prohibited.
- Returns:
new NvJpegEncodeContext.
- Run(self: python_vali._python_vali.PyNvJpegEncoder, context: python_vali._python_vali.NvJpegEncodeContext, surfaces: List[python_vali._python_vali.Surface]) Tuple[List[numpy.ndarray], python_vali._python_vali.TaskExecInfo] ¶
Encode multiple Surfaces. In case of an error it returns empty list and TaskExecInfo.FAIL.
- Parameters:
context – context (NvJpegEncodeContext)
surfaces – list of input Surfaces
- Returns:
tuple, the first element is the list of buffers compressed images. The second element is TaskExecInfo.