pynaviz.audiovideo.VideoHandler.get#

VideoHandler.get(ts)[source]#

Return the frame at (or immediately preceding) a timestamp.

Parameters:

ts (float) – Target time in seconds.

Returns:

If return_frame_array is True, returns an array with shape (H, W, 3) (RGB, float32 in [0, 1]). Otherwise returns an av.VideoFrame.

Return type:

av.VideoFrame | NDArray

Notes

  • Seeks to the closest keyframe behind ts and decodes forward until the target is reached.

  • Uses an internal cache: if the requested frame index matches the previously decoded one, the cached frame is returned.