0

I am trying to setup a multi-stream hardware accelerated (Nvidia's NVENC) encoding system using Opencv compiled with Gstreamer backend as well as nvenc and nvdec plugins baked into Gstreamer.

The setup works fine for <= 3 streams but as soon as I create a 4th VideoWriter object the program freezes.

Freezed Output

Note that when I remove the 4th videoWriter object or change the encoding element from "nvh264enc" to "x264enc" for 4th stream, the program works just fine. The issue does not reproduce with all 4 streams switched to "x264enc". So my guess is that it has something to do with Nvidias NVENC API or underlying hardware? Testing on a laptop with RTX-3070.

Non-Freezed Output

1 Answers1

1

I'm pretty sure that consumer grade NVIDIA GPUs are limited to 3 concurrent NVENC sessions.

See https://developer.nvidia.com/video-encode-and-decode-gpu-support-matrix-new

Florian Zwoch
  • 6,764
  • 2
  • 12
  • 21
  • Thanks, makes sense. Any recommendation for my use case then? How could I possibly leverage GPU for more than 3 stream encoding at the same time – Marib Sultan Oct 17 '22 at 14:33
  • Get a card which supports more; for Linux there are patches floating around to break that artificial limit. – Florian Zwoch Oct 18 '22 at 08:22