NvDsFrameMeta

class pyds.NvDsFrameMeta

Holds metadata for a frame in a batch.

Variables:
  • base_metaNvDsBaseMeta, Base metadata for frame.

  • pad_indexint, Pad or port index of stream muxer component for the frame in the batch.

  • batch_idint, Location of the frame in the batch. NvBufSurfaceParams for the frame will be at index batch_id in the surfaceList array of NvBufSurface.

  • frame_numint, Current frame number of the source.

  • buf_ptsint, Holds the presentation timestamp (PTS) of the frame.

  • ntp_timestampint, Holds the ntp (network time protocol) timestamp.

  • source_idint, Source_id of the frame in the batch e.g. camera_id. It need not be in sequential order.

  • num_surfaces_per_frameint, Number of surfaces present in this frame. This is required in case multiple surfaces per frame.

  • source_frame_widthint, Holds the width of the frame at input to Gst-streammux.

  • source_frame_heightint, Holds the height of the frame at input to Gst-streammux.

  • surface_typeint, Surface type of sub frame. This is required in case multiple surfaces per frame.

  • surface_indexint, Surface index of sub frame. This is required in case multiple surfaces per frame.

  • num_obj_metaint, Number of object meta elements attached to the current frame.

  • bInferDoneint, Boolean indicating whether inference is performed on given frame.

  • obj_meta_list – List of objects of type NvDsObjectMeta in use for the given frame.

  • display_meta_list – List of objects of type NvDsDisplayMeta in use for the given frame.

  • frame_user_meta_list – List of objects of type NvDsUserMeta in use for the given frame.

  • misc_frame_infolist of int, For additional user specific batch info.

  • reservedint, Reserved for internal use.

Example usage:

batch_meta = pyds.gst_buffer_get_nvds_batch_meta(hash(gst_buffer)) #Retrieve batch metadata from gst_buffer
l_frame = batch_meta.frame_meta_list
while l_frame is not None:
    try:
        frame_meta = pyds.NvDsFrameMeta.cast(l_frame.data) #Must cast data in frame_meta_list to NvDsFrameMeta object
    except StopIteration:
        break

    frame_number=frame_meta.frame_num #Retrieve current frame number from NvDsFrameMeta object
    num_rects = frame_meta.num_obj_meta #Retrieve number of objects in frame from NvDsFrameMeta object
    l_obj=frame_meta.obj_meta_list #Retrieve list of NvDsObjectMeta objects in frame from NvDsFrameMeta object
cast(*args, **kwargs)

Overloaded function.

  1. cast(self: capsule) -> pyds.NvDsFrameMeta

cast given object/data to NvDsFrameMeta, call pyds.NvDsFrameMeta.cast(data)

  1. cast(self: int) -> pyds.NvDsFrameMeta

cast given object/data to NvDsFrameMeta, call pyds.NvDsFrameMeta.cast(data)