mne_videobrowser.VideoFileCV2#
- class mne_videobrowser.VideoFileCV2(fname: str)[source]#
Bases:
VideoFileVideo file reader for video files supported by OpenCV.
- Parameters:
fname (str) – Full path to the video file to be read.
Methods
close()Release the video capture object.
get_frame_at(frame_idx)Read a specific frame from the video file.
print_stats()Print statistics about the video file.
Attributes
durationReturn the possibly estimated duration of the video in seconds.
Return the full path to the video file.
Return the frames per second of the video file.
Return the number of frames in the video file.
Return the height of the video frames in pixels.
Return the width of the video frames in pixels.
- get_frame_at(frame_idx: int)[source]#
Read a specific frame from the video file.
- Parameters:
frame_idx (int) – Index of the frame to read.
- Returns:
The frame as a NumPy array of shape (height, width, 3) or None if the frame cannot be read. The color format is RGB and the frame is in row-major order.
- Return type:
npt.NDArray[np.uint8] | None