In an AI video pipeline, video decode can be what limits throughput, not the model. In multimodal serving, video decoding often dominates time-to-first-token. In vLLM video captioning, CPU-based decoding maxed out CPU cores with just 2 or 4 GPUs busy. Before you buy more GPUs, profile decode, preprocessing, inference and post-processing as separate stages, and treat AI video compression (which codec, which GOP structure, where decode runs) as something you design for the workload rather than inherit.
The rest of this article goes through the levers in the order we would check them: where decode runs, how decode and inference compete on one GPU, how codec and GOP structure set the decode bill, what chroma handling does to the model, how codec weighs against the other stages, and which decoder settings to profile before scaling.
How Decode Latency Starves GPU Inference
A model can only run on frames that have already been decoded. If frames arrive late, the GPU waits. One video-training study measured this directly. A video ViT could process 400 to 500 clips per second on an 8-GPU node, but a standard pipeline supplied at most 100 to 120 clips per second, which kept the GPUs at about 25% utilisation. In the same work, the CPU on a single node simply could not supply eight GPUs with enough data, which largely starved them.
Inference serving hits the same limit. One account of an inference accelerator deployment describes video decode running on the host CPU, where it can become the bottleneck and cap the server’s overall throughput. Their fix was to move decode to separate servers, which could use dedicated transcoder ASICs. The vLLM team reported that video captioning workloads on up to 8 GPUs used to hit a CPU bottleneck before reaching 4 GPUs. Hardware decoding through PyNvVideoCodec removed that bottleneck, and at 8×H100 it delivered more than double the throughput of CPU decoding.
Short outputs make the problem worse. When a captioning model produces only 100 to 200 tokens, decoding takes up a much larger share of each request. Lightweight models behave the same way: when the model’s compute is small, data loading becomes the bottleneck.
“Our GPUs sit at 30% utilisation. Is the model the problem?”
We would rule out the decode path first. In video workloads, low GPU utilisation can mean the GPUs are waiting on frames that have not been decoded yet. The 25% utilisation figure above was a decode and preprocessing starvation effect, not a model inefficiency. This is the video-specific case of a wider cost, covered in our piece on the hidden cost of GPU underutilisation.
One trap is worth naming. Decoder latency can rise because of the model, not the codec. On an NVIDIA Orin face-recognition pipeline, decoder and stream-muxer latency went up as recognition latency went up. The authors attributed this to the inference stage slowing down the pipeline, not to any drop in NVDEC or CPU performance. A slow decode stage on a timeline does not prove decode is the cause. You need to know whether the decoder is busy or just blocked by downstream backpressure.
Telling Whether NVDEC and Inference Are Competing for the Same GPU
NVDEC is a fixed-function engine, separate from the streaming multiprocessors (SMs) that run inference, so the decode itself adds little GPU load beyond the YUV-to-RGB conversion. That does not mean the two are independent. When decode and multimodal LLM inference run on the same GPUs, the interference is lopsided. Decoding slows down a lot under inference load, while inference is barely affected. In one December 2025 study, decode latency rose by 48 to 70% as token budgets grew, while per-iteration inference latency rose by less than 2%. In that study’s system, spreading decode across GPUs absorbed this interference. Decode latency stayed below 2 s with 2 to 4 GPUs and under 1 s with 8.
Several other limits decide whether hardware decode can keep up at all:
- One session, one engine. NVIDIA’s Video Codec SDK 13.0 application note states that a single decoding session cannot exceed the performance of one NVDEC, however many engines the GPU has, and that all GeForce products have a single NVDEC.
- Engine count varies by chip. Some Maxwell, Pascal, Volta and Ada variants have two or three NVDEC engines per chip. The driver balances load across them automatically.
- Clock speed matters. NVIDIA says decode performance varies across GPU classes and scales almost linearly with clock speed.
- MIG partitions split the decoders. Under Multi-Instance GPU, NVDEC engines are divided across instances, and some profiles expose none.
- The decoder itself can saturate. With many decode instances, NVDEC can become the bottleneck, and
cuvidDecodePicture()stalls when the driver’s queue is full. - VRAM is shared. GPU decode needs VRAM set aside, which can matter when the KV cache already fills memory.
Diagnostic Checklist: Decode-Bound or Model-Bound?
| What you observe | What it usually points to | What to check next |
|---|---|---|
| Low SM utilisation, CPU cores near 100% | CPU software decode is starving the GPUs | Whether frames are decoded on CPU (OpenCV/FFmpeg) or NVDEC |
| Decode latency rising, inference latency flat | Decode suffering contention from co-located inference | Spreading decode across GPUs, or moving it to a separate decode GPU |
| Decoder and mux latency rising with model latency | Backpressure from a slow inference stage | Model and post-processing timings, not the codec |
| GPU decode enabled but frames still decoded on CPU | Silent fallback to CPU decoding | Codec/format support on NVDEC, NVCUVID present, container driver capability |
Silent fallback deserves its own check. TorchCodec documents that CUDA decoding may fall back to CPU when the codec or format is not supported by NVDEC, or when NVCUVID is not found. NVIDIA’s Dynamo documentation notes that the container runtime only mounts the library NVDEC needs when the video driver capability is requested. Without it, Dynamo falls back to software decode. A pipeline can therefore pass every functional test while decoding on the CPU.
Codec, GOP Structure and Resolution Decide How Much Decoding You Pay For
Codec choice sets decode throughput, and GOP structure sets how many frames you decode that you never use. Frames are grouped into Groups of Pictures. Each starts with a self-contained I-frame, followed by P- and B-frames that depend on earlier decoded content, so frames within a GOP must be decoded in order. When a model needs specific frames rather than playback, seeking outside the current GOP means jumping back to a keyframe and decoding forward, with buffers flushed along the way. For H.264 through the FFmpeg backend, the same study measured that seek at roughly 50 to 100 ms.
B-frames add variance as well as cost. The Orin study (2025) found H.264 decoder latency varied by frame type, with B-frames the most resource-heavy and causing the most delay, while giving the highest compression ratio. A codec tuned for viewers (high compression, long GOPs, many B-frames) is costly for a pipeline that samples frames randomly. That is the practical core of the position that web-default codecs were built for human viewing, not for inference. Our explainer on how video codecs work and what they cost at streaming scale covers the encoding side.
Measured trade-offs from a video analytics case study on poultry farm cameras show how large these levers are:
- MJPEG reached more than 3,000 FPS of frame loading at 480p. H.264 and H.265 stayed consistently lower at the same resolution.
- MJPEG’s intra-frame encoding introduced subtle artefacts in low-light or occluded regions, which slightly hurt detection robustness.
- Dropping H.264 from 1080p to 720p preserved accuracy and cut decode latency by more than 2×, so the team chose H.264 at 720p as its default.
- The pipeline sampled 2 FPS from 30 FPS video, so 14 of every 15 frames were decoded and then thrown away until OpenCV’s
grab()/retrieve()split skipped decoding the unused frames.
Compression level within one codec is a separate dial. For H.264 surveillance video, one study found YOLOv5 detection generally robust to moderate compression. Using CRF 37 instead of 22 cut bitrate substantially without hurting detection. Detection did degrade appreciably at higher compression, especially in complex scenes with poor lighting and fast-moving targets. Two other choices can shrink the decode bill. If you control encoding, NVIDIA describes re-encoding every nth frame as an intra-only H.264/HEVC stream and decoding it with ulIntraDecodeOnly, which reduces memory and speeds up training. And fusing the crop into the decode stage cut data-loading overhead almost 3× in VideoMAE training.
How Chroma Subsampling and Colour Conversion Affect Model Accuracy
Chroma subsampling discards colour detail the eye is less sensitive to, and in one face-recognition study it affected accuracy. Standard lossy codecs drop colour resolution because the eye is less sensitive to colour than to brightness. JPEG uses 4:2:0 subsampling by default. In a 2022 face-recognition study on JPEG still images, removing chroma subsampling (4:4:4) improved the false matching rate by up to 15.95% across the phenotype categories affected by compression, including darker skin tones. The authors found that removing chroma subsampling reduced bias more than training on compressed images did.
That study used JPEG compression and face recognition, so treat it as evidence of the mechanism, not a number to carry over to your detector. The lesson that does transfer is that colour fidelity in compression can affect accuracy, and some classes more than others. Accuracy validation should therefore run on frames decoded exactly as production decodes them.
The decode path also makes colour decisions of its own. NVDEC outputs YUV frames, and the NVDECODE API provides CUDA-optimised colour-space conversion, scaling and cropping. The decoder can also be set to output a different chroma subsampling or bit depth from the input bitstream. Supported chroma formats (monochrome, 4:2:0, 4:2:2, 4:4:4) and bit depths are hardware capabilities you query per GPU. NVIDIA’s published NVDEC throughput figures are measured at 1920×1080 YUV 4:2:0, so a 4:4:4 or 10-bit workload should be measured, not read off that table.
Weighing Codec Choice Against Preprocessing, Data Movement and Post-Processing
Codec choice is a first-order lever, but it is not the only one. The Smol study (VLDB 2021) showed that preprocessing, including decoding and resizing, can be the bottleneck in many visual analytics systems on modern hardware. The poultry case study found its largest cost in post-processing. Its default per-frame cost was 55.8 ms: 8.8 ms of preprocessing, 6.9 ms of inference and 40.2 ms of Python post-processing. Replacing skimage.regionprops with OpenCV’s connectedComponentsWithStats brought post-processing down to 11.4 ms. The authors’ broader conclusion was that bottlenecks came from scheduling, data flow and component interactions, not only from inference.
Data movement sits between the stages. GPU decoding leaves the decoded tensor in GPU memory, so transforms like scaling and cropping do not need a fetch from host memory. Encoded packets are also much smaller than decoded frames, so less traffic crosses PCIe. Post-processing on the CPU still needs a GPU-to-CPU transfer, the hop the poultry study had to restructure.
| Stage | Signal that it is the limit | First lever |
|---|---|---|
| Decode | Low SM utilisation, CPU saturated or NVDEC busy | Move to NVDEC, spread across engines and GPUs, cut wasted frames |
| Codec/GOP | High seek cost, variable frame latency | Fewer seeks, intra-only streams or lower resolution |
| Preprocessing | Decode fast, resize/crop on CPU slow | Fuse crop into decode, place transforms on GPU |
| Inference | SMs busy, upstream queues full | Model optimisation, batching |
| Post-processing | GPU idle while CPU code runs per frame | Faster libraries, keep tensors on GPU |
This is why profiling per stage beats acting on a hunch: a rule like “use hardware decode” or “use a lighter codec” only helps when the profile says decode is the limit.
AI Video Compression Formats Designed for the Pipeline
AI video compression that is designed for the workload, rather than borrowed from web delivery, is a real engineering surface. We hold that GPU-native, AI-aware formats and custom encoders can deliver step-changes in throughput when feeding AI pipelines. SMPTE VC-6 (ST 2117-1) is one example: its hierarchical, tile-based structure lets a pipeline retrieve and decode only the resolution, region of interest or colour plane it needs. NVIDIA reports that redesigning its CUDA VC-6 decoder to decode batches with one decoder, instead of N decoders for N images, cut per-image decode time by up to about 85% at batch size 256 and by about 36% at batch size 1.
Those are NVIDIA’s own figures for image batches, not independent pipeline measurements. The same NVIDIA work makes the broader point that matters most here. Once batches grow, the bottleneck moves from kernel efficiency to orchestration, launch cadence and GPU occupancy. A better format helps only if the pipeline around it keeps up. For how this plays out at the transcoding layer, see our analysis of video transcoding cost and quality trade-offs.
Which Codec and Decode Settings to Profile Before Scaling
These are the settings we would pin down, roughly in order, before adding GPUs to a video pipeline:
- Query decoder capabilities on the exact GPU and MIG profile. NVIDIA recommends querying hardware capabilities rather than assuming them, because decoders differ by generation in codec, chroma format, bit depth and resolution support. Under MIG, verify that decode works in the exact profile you deploy.
- Confirm decode is actually on NVDEC. Check for fallback to CPU (unsupported format, missing NVCUVID, or no video driver capability in the container).
- Size decode surfaces once, deliberately. More decode surfaces improve pipelining but cost GPU memory. To pipeline into inference, NVIDIA suggests the content’s minimum decode surfaces plus 3 or 4. The output surface count caps how many frames you can map at the same time.
- Set the deinterlace mode explicitly. If it is left unset, the driver defaults to Adaptive, which uses more memory. Weave or Bob minimise memory for progressive content.
- Check reference frames and DPB size. More reference frames mean a larger decode picture buffer. Fewer save memory but need more bitrate to hold quality.
- Use intra-only decode where the content allows it.
ulIntraDecodeOnlyapplies only to H.264, HEVC and VP9, and decoding can fail on streams that contain P- or B-frames. - Separate mapping from submission.
cuvidMapVideoFrame()blocks, and calling it on the same thread ascuvidDecodePicture()stops new packets being submitted until mapping completes. - Reconfigure rather than recreate. When resolution or post-processing parameters change often,
cuvidReconfigureDecoder()avoids the latency of destroying and recreating the decoder. - Measure memory on your platform. NVIDIA notes decoder memory varies with OS, GPU architecture and driver. Linux uses somewhat more than Windows.
Our guide to object detection in video and its decode-path costs applies the same checks to detection workloads.
The Question to Settle Before the Next GPU Order
Whether to scale out depends on where frames are waiting. If decode is the limit, more GPUs helped in the studies above when decode was spread across them. A GeForce-class card’s single NVDEC or a MIG slice with no decoders adds compute the pipeline cannot feed. If the limit is post-processing on the CPU, the poultry study saw the speedup from added parallel jobs plateau in its wall and feeder pipelines. The codec decision and the hardware decision should both rest on a stage-by-stage profile of your own streams, at your own resolution, GOP structure and sampling rate, rather than on decoder throughput tables measured at 1080p 4:2:0. Our work on AI engineering for media, broadcast and telecom applies this stage-by-stage profiling to production video pipelines.