VideoInfo

class lib.video.VideoInfo(video_file: str, fast_count: bool = True, stream_index: int = 0, pts: list[int] | None = None, keyframes: list[int] | None = None)

Bases: object

Collects and stores information about video files

Parameters:
  • video_file (str) – Full path to a video file

  • fast_count (bool) – Whether to obtain the count of frames quickly, but inaccurately or slowly but accurately. If pts and keyframes are provided then the count will be derived from the provided pts file. Default: True

  • stream_index (int) – The stream index to select from the video file. Default: 0

  • pts (list[int] | None) – The Presentation Timestamps if available or None to retrieve from the video. Default: None

  • keyframes (list[int] | None) – The keyframe frame indices if available or None to retrieve from the video. Default: None

Attributes Summary

count

The number of frames in the video

duration

The duration of the video file in seconds

keyframes

The frame index of each key frame in the video

keyframes_count

The number of keyframes that exist in the video

pts

The Presentation Time Stamp for each frame in the video

Attributes Documentation

count

The number of frames in the video

duration

The duration of the video file in seconds

keyframes

The frame index of each key frame in the video

keyframes_count

The number of keyframes that exist in the video

pts

The Presentation Time Stamp for each frame in the video

property count: int

The number of frames in the video

property duration: int

The duration of the video file in seconds

property keyframes: npt.NDArray[np.int64]

The frame index of each key frame in the video

property keyframes_count: int

The number of keyframes that exist in the video

property pts: npt.NDArray[np.int64]

The Presentation Time Stamp for each frame in the video