5.15. sail.Decoder

5.15.1. __init__

Interface:
def __init__(self,
            file_path: str,
            compressed: bool = True,
            tpu_id: int = 0)

Parameters

  • file_path : str

Path or rtsp url to the video/image file

  • compressed : bool, default: True

Whether the format of decoded output is compressed NV12.

  • tpu_id: int, default: 0

ID of TPU, there may be more than one TPU for PCIE mode.

5.15.2. is_opened

Judge if the source is opened successfully.

Interface:
def is_opened(self)-> bool

Returns

  • judge_ret : bool

True for success and False for failure

5.15.3. read

Read an image from the Decoder.

Interface:
def read(self, handle: sail.Handle, image: sail.BMImage)-> int

Parameters

  • handle : sail.Handle

Handle instance

  • image : sail.BMImage

BMImage instance

Returns

  • judge_ret : int

0 for success and others for failure

Interface:
def read(self, handle: sail.Handle)-> sail.BMImage

Parameters

  • handle : sail.Handle

Handle instance

Returns

  • image : sail.BMImage

BMImage instance

5.15.4. read_

Read an image from the Decoder.

Interface:
def read_(self, handle: sail.Handle, image: sail.bm_image)-> int

Parameters

  • handle : sail.Handle

Handle instance

  • image : sail.bm_image

bm_image instance

Returns

  • judge_ret : int

0 for success and others for failure

5.15.5. get_frame_shape

Get frame shape in the Decoder.

Interface:
def get_frame_shape(self)-> list

Returns

  • frame_shape : list

The shape of the frame

5.15.6. release

Release the Decoder.

Interface:
def release(self)

5.15.7. reconnect

Reconnect the Decoder.

Interface:
def reconnect(self)