vidsz

vidsz.opencv.writer package

Submodules

vidsz.opencv.writer.base_writer module

Implements vidsz.interfaces.IWriter interface for OpenCV Backend.

class vidsz.opencv.writer.base_writer.Writer(reader: Optional[vidsz.interfaces.reader.IReader] = None, name: Optional[str] = None, width: Optional[int] = None, height: Optional[int] = None, fps: Optional[int] = None, ext: Optional[str] = None)

Bases: vidsz.interfaces.writer.IWriter

Video Writing wrapper around Opencv-Backend

property backend: str

Name of the Backend being used

Returns

current backend name

Return type

str

property ext: str

Extension of Output Video

Returns

ext of video

Return type

str

property fps: float

FPS of Output Video

Returns

fps of video

Return type

float

property frame_count: int

Total frames written

Returns

written frames’ count

Return type

int

property height: int

Height of Output Video

Returns

height of video frame

Return type

int

property info: dict

Video information

Returns

info of width, height, fps, backend and ext

Return type

dict

is_open()bool

Checks if writer is still open

Returns

True if writer is open, False otherwise

Return type

bool

property minutes: float

Total minutes written

Returns

written frames’ in minutes

Return type

float

property name: str

Name of Output Video

Returns

name of output video

Return type

str

release()None

Release Resources

property seconds: float

Total seconds written

Returns

written frames’ in seconds

Return type

float

property width: int

Width of Output Video

Returns

width of video frame

Return type

int

write(frame: numpy.ndarray)None

Write frame to output video

Parameters

frame (np.ndarray) – frame to write

Raises

Exception – raised when method is called on a non-open writer.

write_all(frames: Union[List[numpy.ndarray], vidsz.interfaces.reader.IReader])None

Write all frames to output video

Parameters

frames (Union[List[np.ndarray], IReader]) – Iterable object that contains frames.

Module contents

Implements vidsz’s Writer for Opencv Backend