RAPID: Codec-Aware Video Decoding for Efficient Long-Video Understanding
Authors: Yuna Lee, Yulhwa Kim
Organizations: Dept. of Electrical and Computer Engineering, Sungkyunkwan University · Dept. of Semiconductor Systems Engineering, Sungkyunkwan University
Recent vision-language models (VLMs) can process hour-long videos, but the large number of input frames incurs substantial inference overhead. Existing approaches to efficient long-video understanding largely overlook video decoding, which can take longer than LLM prefill. We propose RAPID (Reference- and Access-Point-Informed Decoding), a codec-aware framework that exploits information embedded in compressed bitstreams to reduce both frame decoding and selection costs. RAPID consists of two components. RAPID-Dec exploits reference-frame information and random access points to skip unnecessary frames and decode the retained frames in parallel while preserving exact reconstruction of the target frames. It achieves up to a 3.7x decoding speedup over the fastest baseline on H.264/AVC videos. RAPID-Sel uses keyframes as coarse representatives of video segments, avoiding the dense candidate decoding and scoring required by existing frame selection methods. It achieves comparable accuracy with up to a 3.0x preprocessing speedup. Together, RAPID achieves a 4.9x time to first token (TTFT) speedup on hour-long videos over a state-of-the-art frame selection method using the fastest baseline decoder.
Figures & tables
Figure 1: Motivation of RAPID. (a) Accuracy of Qwen3-VL-8B on MLVU under different frame sampling settings. (b) Breakdown of TTFT for Qwen3-VL-8B across sampling settings. (c) Video decoding latency at 1 fps without frame capping for different video durations. In (a) and (b), f denotes the number of uniformly sampled frames (64, 128, or 256), while fps denotes frames per second, with sampling capped at 2,048 frames for the 1 fps setting. All videos were decoded using TorchCodec [ 29 ] .
Figure 2: Example of keyframe groups. (a) In display order, each arrow points from a frame to a frame it references. (b) In the bitstream, frames are stored in decoding order, and the bitstream consists of NAL units, each with a header and a payload.
Figure 3: Overview of RAPID. RAPID-Dec (right) decodes target frames chosen by any sampling strategy, including RAPID-Sel (left). It skips groups without target frames, frames after the last target frame of each group, and non-reference frames other than target frames, while preserving exact reconstruction of the targets. The retained groups are then distributed across threads for parallel decoding. RAPID-Sel decodes and scores only the keyframes against the query and selects target frames by combining uniform frames with relevant frames allocated to groups by relevance.
Video-MME
LongVideoBench
MLVU
52.7%
51.8%
37.5%
Table 1: Average ratio of non-reference frames per video.
Figure 4: Video decoding latency of 1 fps sampling (up to 2,048 frames) with different numbers of threads.
Figure 5: Video decoding latency under different frame sampling settings with 16 threads. The y-axis is in log scale.
64 frames
1 fps
Configuration
Lat. (s)
Speedup
Lat. (s)
Speedup
Parallel decoding only
15.91
–
16.38
–
+ Group skipping
2.20
7.23 ×
15.94
1.03 ×
+ Truncation
1.84
1.20 ×
13.03
1.22 ×
+ Workload balancing
1.77
1.04 ×
12.90
1.01 ×
+ Non-ref. skipping (full)
1.45
1.22 ×
8.72
1.48 ×
Table 2: Ablation of RAPID-Dec. Decoding latency (Lat.) on videos of Fig. 5(a) . Components are added cumulatively, and speedup is relative to the previous row.
Figure 6: Latency of decoding frames sampled at 1 fps from H.264/AVC videos in Video-MME with 16 threads.
Qwen3-VL-8B
GLM-4.6V-Flash
Method
#Frames
Preproc. (s) ↓
Video-MME
MLVU
LVB
Avg.
Video-MME
MLVU
LVB
Avg.
Uniform
32
0.60
60.26
60.69
55.95
58.97
57.15
58.68
55.27
57.03
Top-K
32
3.41
61.56
68.81
57.89
62.75
59.70
67.08
60.13
62.30
AKS
32
3.41
61.44
65.84
56.99
61.42
59.26
61.70
57.67
59.54
Focus
32
2.36
61.04
67.40
58.27
62.24
58.30
64.76
60.21
61.09
WFS-SB
32
3.41
62.78
66.81
58.26
62.62
60.93
64.33
58.49
61.25
Table 3: Accuracy (%) and preprocessing latency on Video-MME, MLVU, and LongVideoBench (LVB). Preproc. is the per-video latency of RAPID-Dec decoding and CLIP ViT-B/32 scoring, averaged over three runs on 10% of the videos of each benchmark.
Candidates
Short
Medium
Long
Avg.
Uniform
76.22
63.67
55.22
65.04
Keyframes
75.67
63.78
56.78
65.41
Table 4: Uniform vs. keyframe candidates of RAPID-Sel, equal in number, on Video-MME with Qwen3-VL-8B and 64 frames.
Figure 7: Keyframe placement and visual consistency over 2,098 videos of Video-MME, LongVideoBench, and MLVU. (a) Per-video fraction of low-similarity 1 s intervals (CLIP similarity below 0.73) containing a keyframe. (b) CDFs of CLIP similarity between adjacent 1 fps frames within a group, across a keyframe, and between each keyframe and the other frames of its group.
ρ
Short
Medium
Long
Avg.
0.45
75.44
63.67
55.22
64.78
0.50
75.67
63.78
56.78
65.41
0.55
75.22
63.22
56.11
64.85
0.60
76.00
61.89
55.22
64.37
Uni. ( ρ=1 )
74.56
61.89
54.44
63.63
Table 5: Impact of ρ (Video-MME, Qwen3-VL-8B, 64 frames).
Figure 8: TTFT breakdown of Qwen3-VL-8B with 64 frames on hour-long videos. The first four bars use AKS with each decoder. Others includes relevance scoring and frame selection.
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 9: Video decoding latency using NVDEC. The y-axis is in log scale.
Figure 10: Video decoding latency of 1 fps sampling (up to 2,048 frames) with different numbers of threads on the AMD CPU.
Figure 11: Video decoding latency under different frame sampling settings with 16 threads on the AMD CPU. The y-axis is in log scale.
Figure 12: Video decoding latency on the Video-MME videos of each duration with 16 threads.
Figure 13: Video decoding latency on all Video-MME videos and on two special cases with 16 threads.
Candidates
Preproc. (s) ↓
Short
Medium
Long
Avg.
None
0.75
74.56
61.89
54.44
63.63
Uniform
2.87
76.22
63.67
55.22
65.04
Keyframes
1.39
75.67
63.78
56.78
65.41
Appendix
Table 6: Accuracy (%) and preprocessing latency of uniform vs. keyframe candidates of RAPID-Sel on Video-MME with Qwen3-VL-8B and 64 frames.
Figure 14: Average accuracy over the three benchmarks vs. TTFT of Qwen3-VL-8B with 32 to 256 frames.
Figure 15: Medians of keyframes and low-similarity intervals (Low-sim) per minute in ten groups of videos sorted by keyframes per minute.
Figure 16: Keyframes in a sparse minute (left) and a dense minute (right) of four videos. Each plot shows the CLIP similarity of adjacent 1 fps frames, the threshold of 0.73 for low-similarity intervals, and the keyframes of the minute. Below each plot are three consecutive keyframes of the minute.