How much 1080@30fps can be run in one NVDEC

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) 3090RTX
• DeepStream Version 9.0
• JetPack Version (valid for Jetson only)
• TensorRT Version deepstream installation
• NVIDIA GPU Driver Version (valid for GPU only) 590
• Issue Type( questions, new requirements, bugs)
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

I want to determine how many simultaneous video streams my GPU can decode before NVDEC utilization exceeds 90%.
For example, my application may have 5, 10, 15, 20, or 40 input streams. Before starting all streams, I would like to estimate or calculate their expected NVDEC usage so I can decide how many streams should use hardware decoding and how many should use software decoding.
For instance, with 40 input streams, I may want to assign 20 streams to NVDEC and the remaining 20 streams to a software decoder.

I will handle the decoder switching logic myself. I only need a reliable way, preferably from Python, to:

  1. Measure the current NVDEC utilization.

  2. Determine whether it has exceeded 90%.

  3. Estimate how many additional streams can be assigned to NVDEC before reaching that threshold.

The streams may have different resolutions, frame rates, codecs, and bitrates, so I understand that the number of supported streams cannot be determined from the stream count alone. i want somthing to have this parameters on it.
i also know this page related to number of nvdec in every device:

The current NVDEC utilization and whether it exceeds 90% can be obtained through NVML, including from Python via nvmlDeviceGetDecoderUtilization().

However, the maximum number of additional streams can only be estimated. NVDEC load depends on codec, resolution, frame rate, bitrate, profile, bit depth, GOP structure, GPU clocks, and the rest of the pipeline. Without the exact stream parameters, there is no reliable formula or API that can calculate the remaining stream capacity.

The recommended approach is to monitor the current utilization and benchmark representative streams. The measured utilization can then be used to estimate how many additional streams may be supported.

   import time
  import statistics
  from collections import deque
  import pynvml

  GPU_ID = 0
  THRESHOLD = 90
  WINDOW = 30

  pynvml.nvmlInit()
  try:
      handle = pynvml.nvmlDeviceGetHandleByIndex(GPU_ID)
      values = deque(maxlen=WINDOW)

      while True:
          utilization, sample_us = \
              pynvml.nvmlDeviceGetDecoderUtilization(handle)

          values.append(utilization)
          ordered = sorted(values)
          p95 = ordered[int(0.95 * (len(ordered) - 1))]
          avg = statistics.fmean(values)

          print(
              f"decoder={utilization}% "
              f"avg={avg:.1f}% p95={p95:.1f}% "
          )
          time.sleep(1)
  finally:
      pynvml.nvmlShutdown()