Codec-guided Selection Cheaply Removes Redundant Frames for Video LMMs

Luca Zanella, Muhammad Ferjad Naeem, Yongqin Xian, Elisa Ricci, Massimiliano Mancini, Federico Tombari, Alessio TonioniarXiv 2026

TL;DR

Feeding videos to Large Multimodal Models (LMMs) at a fixed frame rate wastes massive compute on static, repetitive scenes—yet existing neural "frame selectors" often burn just as much time inspecting the frames to figure out which ones to drop. CodecSelect bypasses neural preprocessing entirely by reading the spatiotemporal math your video codec already computed during compression. The result is a plug-and-play, training-free filter that slashes query latency by up to 36% without sacrificing accuracy.

What Problem Does This Paper Address?

To understand how events unfold over time, modern video LMMs typically sample videos densely at a fixed rate (like 2 frames per second). When nothing happens on screen, consecutive frames are nearly identical, yet every redundant frame forces the LMM to encode and attend to hundreds of extra visual tokens.

To trim the fat, researchers built query-agnostic, embedding-based selectors: lightweight vision backbones (like CLIP or DINOv2) that scan all candidate frames, map them into an embedding space, and pick the most diverse or "surprising" ones. Here is the catch: encoding every candidate frame with a neural network and searching over the results introduces a massive selection overhead. As videos get longer, the time spent picking frames cancels out—or even exceeds—the time saved inside the LMM!

Figure 1. Moving frame selection into the video decoder. Top: embedding-based selectors encode all N candidate frames with a vision backbone Φselect, then search over them. Bottom: Codec- Select uses no neural network. It reads two signals the decoder already computes from the bitstream B, ER and EI, and keeps a frame once they show enough change or enough time has passed.

Methods

Instead of running a neural network to spot visual changes, the authors realize that standard video encoders (like H.264 and HEVC) already did that work when compressing the file. Video codecs don't store full images for every frame; they predict blocks of pixels from neighboring blocks (intra-prediction) or previous/future frames (inter-prediction), saving only the prediction mode and the leftover error.

CodecSelect hooks directly into the standard video decoding pass—before pixels are even reconstructed—and extracts two featherweight scalar signals per frame:

  1. Residual Energy ($E_R$): The sum of squared dequantized transform coefficients. This measures how badly the encoder's prediction missed the mark (e.g., erratic motion or complex new textures).
  2. Intra-Block Ratio ($E_I$): The fraction of the frame's area coded without referencing other frames. If a smooth, uniform object slides into view, its residual error might be tiny, fooling $E_R$—but because no prior frame contains it, the encoder switches to intra-coding, causing $E_I$ to spike.
Figure 3. What each signal captures. Frames t −2 to t, with the intra-coded blocks (EI) and the residual energy per block (ER) of frame t. (a) Predictable motion: almost no intra blocks or residual. (b) A cut starts a new keyframe: all blocks are intra and the residual is the largest of the video. (c) A new scene enters from the left: coded intra (EI rises), but well predicted within the frame (ER stays low).

CodecSelect averages $E_R$ and $E_I$ into a single visual novelty score. However, because codec signals only compare adjacent frames, a slow camera pan creates tiny frame-to-frame deltas that sum to almost nothing while the scene quietly drifts. To catch gradual drift, CodecSelect combines accumulated codec evidence with elapsed time. Starting from a uniform 2 FPS grid, it keeps a frame whenever the sum of codec change and elapsed time hits a threshold $\theta$ (set to 1 second). Rather than sampling at a constant clock rate, it samples at a roughly constant amount of change.

Datasets

Because CodecSelect is completely training-free, no training datasets are used. The authors evaluate it across five established video benchmarks spanning short clips to hour-long recordings:

  • Short temporal reasoning: TempCompass, MVBench, and TVBench (where answers hinge on fine-grained temporal dynamics).
  • Long-form video understanding: Video-MME and LongVideoBench.

Key Insights and Ideas

  • Don't pay twice for spatiotemporal analysis: Video compression and frame selection are two sides of the same coin. Just as encoders spend bits where content changes, LMMs should spend tokens where content changes.
  • Neural selection doesn't scale to long videos: On 45–60 minute videos, embedding-based selectors take 61 to 116 seconds just to pick frames. CodecSelect takes 2.3 seconds—and adds under 1.5% to total query time.
  • Coverage beats "peak" picking: Ablations in SigLIP 2 embedding space show that picking only peak-novelty or maximally diverse frames leaves long, unmonitored blind spots in the video. Bounding the maximum time gap via the elapsed-time term ensures steady temporal coverage, which strongly correlates with downstream LMM accuracy (Spearman 0.89).
  • Codec-agnostic robustness: Even if you re-encode videos from H.264 to HEVC, strip out B-frames, or heavily degrade visual quality (CRF 35), CodecSelect still picks 87–96% of the exact same frames.

Key Results

Evaluated across four off-the-shelf LMMs (Qwen3-VL-8B, Qwen3.5-9B, InternVL3.5-8B, and Gemma-4-12B):

  • Short benchmarks: CodecSelect keeps 64% of the 2 FPS frames, matching dense sampling accuracy (66.0% average for both) while cutting median per-query latency to 0.64$\times$ (a 36% reduction). Meanwhile, KTV slows inference down to 1.30$\times$, and fast non-neural baselines (I-frames, PySceneDetect) drop 13–14 accuracy points by keeping too few frames.
  • Long benchmarks (Qwen3-VL-8B): Every embedding-based selector tested ends up slower than naive dense sampling (taking 79–133s vs. 72–75s). CodecSelect answers 14% faster on Video-MME (62s vs. 72s, 71.2% vs. 71.3% accuracy) and 16% faster on LongVideoBench (63s vs. 75s) while slightly improving accuracy (67.4% vs. 65.9%).
Figure 4. Accuracy vs latency, averaged over the LMMs and benchmarks of Tab. 1. Latency relative to dense sampling.

Limitations and Future Work

  • Whole-frame granularity & uniform decoding: Because inter-predicted frames depend on prior reference frames, standard decoders still have to parse and reconstruct most of the video stream—CodecSelect skips passing redundant frames to the LMM, not decoding them. Furthermore, it drops entire frames rather than pruning redundant spatial patches within a kept frame; the authors note this makes it naturally complementary to codec-guided token merging/pruning methods.
  • Query-agnostic by design: Because it ignores the user's text prompt so representations can be cached, CodecSelect cannot zoom in on a subtle, low-motion background detail if a specific question suddenly asks about it, though its elapsed-time floor guarantees no segment goes completely unseen for longer than $\theta$ seconds.

Summary updated

BibTeX
@misc{zanella2026codec,
  author = {Luca Zanella and Muhammad Ferjad Naeem and Yongqin Xian and Elisa Ricci and Massimiliano Mancini and Federico Tombari and Alessio Tonioni},
  title = {{Codec-guided Selection Cheaply Removes Redundant Frames for Video LMMs}},
  year = {2026},
  eprint = {2611.36681},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.36681},
}
Figure