Vidformer: Drop-in Declarative Optimization for Rendering Video-Native Query Results
Dominik Winecki, Arnab Nandi
TL;DR
Vidformer tackles the bottleneck of rendering visualization videos from video-native queries by converting imperative visualization scripts into declarative frame expressions and executing them in a optimized rendering engine. It provides a drop-in one-line API shim to lift existing OpenCV/Python code, and serves results via a Video on Demand pipeline with just-in-time segment rendering, achieving sub-second time-to-playback and a substantial full-render speedup. The system handles complex tasks including out-of-order frame access, raster data, and LLM-driven queries, while supporting in-situ video I/O and incremental streaming. Empirical results show a $2$–$3\times$ render-time improvement and ~ $400\times$ playback latency reduction when using VOD, with additional gains from GPU acceleration and scalable threading. This work enables interactive, AI-assisted video data exploration and paves the way for real-time, LLM-enabled video querying over large video collections.
Abstract
When interactively exploring video data, video-native querying involves consuming query results as videos, including steps such as compilation of extracted video clips or data overlays. These video-native queries are bottlenecked by rendering, not the execution of the underlying queries. This rendering is currently performed using post-processing scripts that are often slow. This step poses a critical point of friction in interactive video data workloads: even short clips contain thousands of high-definition frames; conventional OpenCV/Python scripts must decode -> transform -> encode the entire data stream before a single pixel appears, leaving users waiting for many seconds, minutes, or hours. To address these issues, we present Vidformer, a drop-in rendering accelerator for video-native querying which, (i) transparently lifts existing visualization code into a declarative representation, (ii) transparently optimizes and parallelizes rendering, and (iii) instantly serves videos through a Video on Demand protocol with just-in-time segment rendering. We demonstrate that Vidformer cuts full-render time by 2-3x across diverse annotation workloads, and, more critically, drops time-to-playback to 0.25-0.5s. This represents a 400x improvement that decouples clip length from first-frame playback latency, and unlocks the ability to perform interactive video-native querying with sub-second latencies. Furthermore, we show how our approach enables interactive video-native LLM-based conversational querying as well.
