Video
def Video(source, *, format: str = "h264")Create a single-row video archetype write helper.
The source is usually a se.Blob(...). At write time Spiral stores the
canonical video struct with the source blob and a generated video index.
read
def read(video_or_source: ExprLike,
frame_indices: ExprLike | None = None,
selection: ExprLike | None | object = _UNSET,
*,
width: int | None = None,
height: int | None = None,
format: str = "h264",
decoder: str | None = None,
pixel_format: str = "rgb") -> ExprDecode selected video frames on CPU from a video archetype.
Arguments:
video_or_source- Video archetype column written withse.Video(...). The legacyread(source, index, selection)form is still accepted.frame_indices- A list-like scalar or column of display-order frame indices. If omitted, all indexed frames are decoded.width- Optional output frame width. If omitted, uses source width.height- Optional output frame height. If omitted, uses source height.pixel_format- Output pixel format."rgb"returns packed RGB bytes in the legacydatafield."yuv420"returns raw luma/chroma planes asyand interleaveduvfields without CPU colorspace conversion or resize.
Returns:
A struct expression with:
frames: RGB frame records{data, pts_seconds, duration_seconds}, or YUV420 frame records{y, uv, pts_seconds, duration_seconds}frame_shape:[height, width, 3]for the row
Each RGB frame data payload stores tightly packed uint8 bytes in NHWC
order. Each YUV420 uv payload stores interleaved U/V samples at half
resolution. Users can map this result to Torch tensors after scanning.
remux
def remux(video_or_source: ExprLike,
frame_indices: ExprLike | None = None,
selection: ExprLike | None | object = _UNSET,
*,
format: str = "h264") -> ExprRemux selected H.264 frames into a playable MP4 payload.
Arguments:
video_or_source- Video archetype column written withse.Video(...). The legacyremux(source, index, selection)form is still accepted.selection- A list-like scalar or column of display-order frame indices. If omitted, all indexed frames are remuxed.
Returns:
A binary MP4 payload that presents the selected frames. Decode dependencies may be included in the MP4, but are hidden from playback. This is useful for previews, debug artifacts, and returning playable clips from scan results without re-encoding pixels.