pynaviz.audiovideo.video_plot#
Module for time-synchronized video plotting using pygfx and multiprocessing.
Classes
|
Abstract base class for time-synchronized video plots using pygfx. |
|
Visualization for 3-dimensional time series ( |
|
Visualization for rendering video files synchronized with a time series. |
- class pynaviz.audiovideo.video_plot.PlotBaseVideoTensor(data, index=None, parent=None)[source]#
Bases:
_BasePlot,ABCAbstract base class for time-synchronized video plots using pygfx.
Subclasses must implement the methods to provide video frames as 2D tensors.
- set_frame(target_time)[source]#
Set the video display to the frame closest to the target time.
- Parameters:
target_time (
float) – Time in seconds to seek to.
- superpose_points(tsdframe, color=None, markersize=10, thickness=2, label=None)[source]#
Superpose a set of points on top of the video plot. Argument tsdframe should be a nap.Tsdframe with multiple of 2 columns (x1, y1, x2, y2, …). The label of the columns doesn’t matter.
- Parameters:
tsdframe (
nap.TsdFrame) – Time series data to overlay.color (
strorrgba tuple, optional) – Color of the set of points.markersize (
float, default10) – Size of the set of points.thickness (
float, default2) – Thickness of the lines connecting the points.label (
str, optional) – Label for the set of points. If None, a default label is assigned.
- class pynaviz.audiovideo.video_plot.PlotTsdTensor(data, index=None, parent=None)[source]#
Bases:
PlotBaseVideoTensorVisualization for 3-dimensional time series (
nap.TsdTensor) displayed as movies.- Parameters:
data (TsdTensor)
- class pynaviz.audiovideo.video_plot.PlotVideo(video, t=None, stream_index=0, index=None, start_worker=True, parent=None)[source]#
Bases:
PlotBaseVideoTensorVisualization 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.
- Parameters:
- animate()[source]#
Main render loop callback for pygfx.
Handles texture and text update, syncing, and redraw triggering.
- property data#
Read-only access to the video data handler.