pynaviz.video.video_plot#

Video display

Classes

PlotBaseVideoTensor(data[, index, parent])

Abstract base class for time-synchronized video plots using pygfx.

PlotTsdTensor(data[, index, parent])

Video tensor plot for Pynapple TsdTensor objects.

PlotVideo(video_path[, t, stream_index, ...])

Video visualization class for rendering video files synchronized with a time series.

class pynaviz.video.video_plot.PlotBaseVideoTensor(data: Any, index: int | None = None, parent: Any | None = None)[source]#

Bases: _BasePlot, ABC

Abstract base class for time-synchronized video plots using pygfx.

Subclasses must implement the methods to provide video frames as 2D tensors.

group_by(metadata_name: str, spacing: Optional = None)[source]#

Placeholder for future metadata grouping method.

set_frame(target_time: float)[source]#

Set the video display to the frame closest to the target time.

Parameters:

target_time (float) – Time in seconds to seek to.

sort_by(metadata_name: str, mode: str | None = 'ascending')[source]#

Placeholder for future metadata sorting method.

class pynaviz.video.video_plot.PlotTsdTensor(data: TsdTensor, index=None, parent=None)[source]#

Bases: PlotBaseVideoTensor

Video tensor plot for Pynapple TsdTensor objects.

class pynaviz.video.video_plot.PlotVideo(video_path: str | Path, t: ndarray[tuple[int, ...], dtype[_ScalarType_co]] | None = None, stream_index: int = 0, index=None, parent=None)[source]#

Bases: PlotBaseVideoTensor

Video visualization class for rendering video files synchronized with a time series.

This class uses shared memory and multiprocessing to efficiently stream frames from disk to GPU via pygfx. It also supports real-time interaction and frame-based control.

close()[source]#

Cleanly close shared memory, worker, and background thread.

property data#

Read-only access to the video data handler.