Skip to main content
Vane Data / Reference

build_video_index

build_video_index uses the selected backend and returns an opaque BLOB recording the actual presentation-order frames and their keyframe anchors. For repeated frame selections, build the index once and store the result alongside its VIDEOFILE.

Building an index performs a complete content-hashing pass and a complete sequential decode; it does not store decoded pixels or encoded video content.

Signature

example.py
vane.build_video_index(
    value, *, max_input_bytes=8589934592, max_decoded_frames=1000000,
    max_pixels=33554432, max_index_bytes=67108864,
) -> Expression

SQL: build_video_index(file, max_input_bytes, max_decoded_frames, max_pixels, max_index_bytes).

Parameters

NameTypeDescriptionDefault
valueVIDEOFILE value or ExpressionSource video to indexRequired
max_input_bytesInteger or ExpressionEncoded input limit8 GiB (maximum 16 GiB)
max_decoded_framesInteger or ExpressionFull-decode budget during construction1,000,000
max_pixelsInteger or ExpressionPixel limit32 Mi pixels
max_index_bytesInteger or ExpressionIndex size limit; may only be lowered64 MiB

Returns and errors

Returns an opaque BLOB that binds the FILE view, codec build, and decoded frame order. An index belongs to one immutable FILE view; source metadata or runtime identity changes require rebuilding it. Indexes require a known time base, unique strictly increasing presentation timestamps, and an initial keyframe; variable frame rates, nonzero timestamp origins, and B frames are supported within that contract. Duplicate/missing timestamps and discontinuities are unsupported. NULL input returns NULL.

Example

query.sql
CREATE TABLE indexed_videos AS
SELECT file, build_video_index(file) AS seek_index FROM videos;