pupil_recording_interface.VideoReader.read_frames

VideoReader.read_frames(start=None, end=None, raw=False, return_timestamp=False, return_index=False)

Generator for frames.

Parameters
  • start (int or pandas.Timestamp, optional) – If specified, start the generator at this frame index or timestamp.

  • end (int or pandas.Timestamp, optional) – If specified, stop the generator at this frame index or timestamp.

  • raw (bool, default False) – If True, return raw frames, otherwise return processed frames.

  • return_timestamp (bool, default False) – If True, also return the corresponding timestamp of the frame.

  • return_index (bool, default False) – If True, also return the corresponding index of the frame.

Yields
  • frame (numpy.ndarray) – The loaded frame.

  • timestamp (pandas.Timestamp) – The corresponding timestamp if return_timestamp is True.

  • index (int) – The corresponding index if return_index is True.