← All answersEvaluation & deployment

What are the key performance bottlenecks when streaming live RTSP camera feeds into a vision pipeline?

Short answer

In a live RTSP pipeline the model is often not the bottleneck. The usual culprits are video decoding (H.264/H.265 on the CPU is expensive), frame buffering and latency (frames pile up if inference can't keep up), CPU-to-GPU memory transfers, and the per-frame pre/post-processing. The fixes: decode on the GPU, drop stale frames instead of queueing them, batch streams, and keep data on the GPU.

People profile the model, see it's fast enough, and are baffled that the live feed lags. The time is going elsewhere in the pipeline.

Where the time actually goes

  • Decoding: turning the compressed RTSP stream into frames is heavy on the CPU. Use hardware decode (NVDEC / GStreamer / DeepStream) to offload it.
  • Buffering and latency: if inference is slower than the incoming frame rate, frames queue and you fall behind. Drop to the latest frame instead of processing stale ones.
  • Memory transfers: copying every frame CPU-to-GPU stalls the GPU. Keep frames on the GPU end to end.
  • Pre/post-processing: resizing, letterboxing and NMS add up; move them onto the GPU where possible.
  • Network: a flaky RTSP source causes stutter and reconnects - handle drops gracefully.

For many-camera deployments, a purpose-built pipeline like NVIDIA DeepStream handles hardware decode and batched inference across streams, and usually beats a naive per-camera OpenCV loop by a wide margin. Profile the whole pipeline, not just model.predict().

Stuck on this in a real project?

Book a free call and I’ll give you a straight answer on your specific case.

Book a consultation