sima.video_reader

Attributes

logger

Classes

Reader

Helper class that provides a standard way to create an ABC using

Writer

Helper class that provides a standard way to create an ABC using

RTSPReader

Helper class that provides a standard way to create an ABC using

FolderImageReader

PCIeReader

Helper class that provides a standard way to create an ABC using

RTSPWriter

Helper class that provides a standard way to create an ABC using

PCIeWriter

Helper class that provides a standard way to create an ABC using

VideoReader

A class for reading video from various sources, including pcie, rtspsrc and filesrc.

VideoWriter

A class for writing video stream to various destinations, including pcie, rtspsrc and filesrc.

Module Contents

sima.video_reader.logger[source]
class sima.video_reader.Reader[source]

Helper class that provides a standard way to create an ABC using inheritance.

abstract read() Tuple[int, numpy.ndarray][source]
abstract isOpened() bool[source]
abstract get_cam_resolution() Tuple[int, int][source]
abstract release()[source]
class sima.video_reader.Writer[source]

Helper class that provides a standard way to create an ABC using inheritance.

abstract write(frame, meta=None)[source]
abstract release()[source]
class sima.video_reader.RTSPReader(cam_source: str)[source]

Helper class that provides a standard way to create an ABC using inheritance.

frame_num = 0[source]
app_source = 'rtspsrc location=Uninferable latency=0 ! rtph264depay wait-for-keyframe=true ! h264parse !...[source]
cap[source]
get_cam_resolution() Tuple[int, int][source]

Get frame width and frame height

read()[source]
isOpened() bool[source]
release()[source]
class sima.video_reader.FolderImageReader(folder_path: str, frame_width: int = 1280, frame_height: int = 720)[source]
folder_path[source]
loop = False[source]
image_files[source]
frame_num = 0[source]
total_images[source]
current_index = 0[source]
set_loop(val)[source]
get_cam_resolution() Tuple[int, int][source]

Get frame width and frame height

read() Tuple[int, numpy.ndarray][source]
isOpened() bool[source]
release()[source]
class sima.video_reader.PCIeReader(frame_width: int = 1280, frame_height: int = 720, data_buf_name: str = 'in-img-source')[source]

Helper class that provides a standard way to create an ABC using inheritance.

app_source = 'simaaipciesrc buffer-size=0 ! appsink sync=true max-buffers=100 drop=true'[source]
data_reader[source]
frame_num = 0[source]
get_cam_resolution() Tuple[int, int][source]

Get frame width and frame height

read() Tuple[int, numpy.ndarray][source]
isOpened() bool[source]
release()[source]
class sima.video_reader.RTSPWriter(host_ip: str, port: int, width: int, height: int)[source]

Helper class that provides a standard way to create an ABC using inheritance.

app_sink = 'appsrc ! video/x-raw,format=NV12,width=Uninferable,height=Uninferable,framerate=30/1 !...[source]
writer[source]
write(frame, meta=None)[source]
release()[source]
class sima.video_reader.PCIeWriter(data_buf_name: str = 'overlay', frame_width: int = 1280, frame_height: int = 720)[source]

Helper class that provides a standard way to create an ABC using inheritance.

buf_size = 0[source]
app_sink = 'appsrc ! simaaimetaparser dump-data=false ! simaaipciesink data-buffer-size=0...[source]
data_writer[source]
write(frame, meta=None)[source]
release()[source]
class sima.video_reader.VideoReader(source: str = None, frame_width: int = 1280, frame_height: int = 720)[source]

A class for reading video from various sources, including pcie, rtspsrc and filesrc.

read() Tuple[int, numpy.ndarray][source]

Reads a frame from the video source.

isOpened() bool[source]

Check whether the video source has been successfully opened.

This method verifies that the underlying video reader or stream is properly initialized and ready for reading frames.

Returns:

True if the video source is open and accessible; False otherwise.

Return type:

bool

get_cam_resolution() Tuple[int, int][source]

Get frame width and frame height

release()[source]

Releases the VideoReader resources.

set_loop(val)[source]
property frame_num[source]
class sima.video_reader.VideoWriter(source: str = None, host_ip: str = None, port: int = None, frame_width: int = None, frame_height: int = None)[source]

A class for writing video stream to various destinations, including pcie, rtspsrc and filesrc.

write(frame, meta=None)[source]

Writes a frame to the video sink.

release()[source]

Releases the VideoWriter resources.