Support for loading video frames (by chunk) in background process.

class int = 9010)[source]#

Supports fetching chunks from video in background process.

property chunks: Iterator[Tuple[List[int], numpy.ndarray]]#

Generator for fetching chunks of frames.

When all chunks are loaded, closes the server and communication ports.


Tuple with (list of frame indices, ndarray of frames)


Close the async video server and communication ports.

classmethod from_video(video:, frame_idxs: Optional[Iterable[int]] = None, frames_per_chunk: int = 64)[source]#

Create object and start loading frames in background process.

load_by_chunk(video:, frame_idxs: Optional[Iterable[int]] = None, frames_per_chunk: int = 64)[source]#

Sends request for loading video in background process.

  • video – The Video to load

  • frame_idxs – Frame indices we want to load; if None, then full video is loaded.

  • frames_per_chunk – How many frames to load per chunk.


None, data should be accessed via :py:method:`chunks`.

class int)[source]#

Class which loads video frames in background on request.

All interactions with video server should go through AsyncVideo which runs in local thread.


Method to be run in sub-process; can be overridden in sub-class