movis.layer.media.Video#

class movis.layer.media.Video(video_file: str | PathLike, audio: bool = True)[source]#

Video layer to encapsulate various formats of video data.

Args:
video_file:

the source of the video data. It can be a file path (str or Path).

audio:

whether to include the audio layer. Default is True.

Methods

get_audio(start_time: float, end_time: float) ndarray | None[source]#
get_key(time: float) int[source]#

Get the state index for the given time.

has_audio() bool[source]#

Return True if the video has audio layer.

Attributes

audio

Whether the video has audio data.

duration

The duration of the video.

fps

The frame rate of the video.

n_frame

The number of frames in the video.

size

The size of the video with a tuple of (width, height).