For video data, .tensor is a 4-dim array, where the first dimension represents the frame id, or time. The last three dimensions represent the same thing as in image data. Here we got our d.tensor.shape=(250,176,320,3), which means this video is sized in 176x320 and contains 250 frames. Based on the overall length of the video (10s), we can infer the framerate is around 250/10=25fps.
We can put each frame into a sub-Document in .chunks as use image sprite to visualize them.
Additionally, if only_keyframes=False the keyframe indices will be stored in .tags['keyframe_indices'] when you call .load_uri_to_video_tensor(). This way, you can easily access selected scenes:
This creates a generator that yields a Document for each frame. You can control the framerate via fps parameter. Note that the upper bound of the framerate is determined by the hardware of webcam, not the software. Press Esc to exit.