Skip to main content
Vane Data / Reference

video_scan_stats

video_scan_stats runs selection and returns diagnostics without output images. A non-NULL idx selects a single exact frame instead. Indexed reads still convert unscaled RGB pixels to verify decoded content.

Signature

example.py
vane.video_scan_stats(
    value, *, start_time=0, end_time=None, is_key_frame=None,
    sample_interval_seconds=None, idx=None, index=None,
    max_input_bytes=8589934592, max_decoded_frames=1000000, max_pixels=33554432,
) -> Expression

SQL: video_scan_stats(file, start_time, end_time, is_key_frame, sample_interval_seconds, max_input_bytes, max_decoded_frames, max_pixels, idx, index).

Parameters

NameTypeDescriptionDefault
valueVIDEOFILE value or ExpressionSource videoRequired
start_time / end_timeNumber or ExpressionInclusive time window in seconds relative to stream start0 / None
is_key_framebool, Expression, or NoneTrue selects keyframes, False selects non-keyframes, and None disables this filterNone
sample_interval_secondsNumber or ExpressionEmit frames when timestamps reach the next interval targetNone
idxBIGINT or ExpressionSelect one exact frame instead of scanningNone
indexIndex BLOB or ExpressionVerified seek index from build_video_index; NULL selects sequential decodingNone
max_input_bytesInteger or ExpressionEncoded input limit8 GiB (maximum 16 GiB)
max_decoded_framesInteger or ExpressionPer-input decoded-frame limit1,000,000
max_pixelsInteger or ExpressionInput and output pixel limit32 Mi pixels

Returns and errors

Returns a STRUCT with bytes_read, decoded_frames, seeks, and selected_frames. Bytes include verification block reads; frames count decoder outputs including discarded preroll, excluding codec-internal lookahead. This is a separate diagnostic execution with no output images.

Example

query.sql
SELECT video_scan_stats(file, start_time => 1, end_time => 5)
FROM (SELECT video_file('clip.mp4') AS file);