Video inference: frame sampling and per-frame token cost
Fields
flops/video-inference-frame-sampling-and-per-frame-token-costNotes
VIDEO INFERENCE COST: Video is the most expensive multimodal input because frame count multiplies the per-frame cost. A 1-minute video at 1 fps = 60 frames. At 448x448 per frame with 2x2 spatial merge (Qwen2-VL style) = 256 tokens per frame. Total visual tokens = 60*256 = 15,360. This is 15x a typical 1000-token text prompt. LLM prefill cost = 2*7e9*15,360 = 215 TFLOPs, which is 15x the cost of a 1000-token text prompt. KV cache cost = 15,360 * 57,344 B/token = 881 MB for a 7B model. For a 5-minute video at 2 fps = 600 frames = 153,600 visual tokens = 8.6 GB KV cache. The frame sampling rate is the primary cost knob: halving the rate halves the cost. LLaVA-NeXT-Video uses 1 fps sampling. Pixtral uses variable frame sampling based on video duration. The token counts are derived from the model configs; the FLOP and KV cache formulas are standard.