Decrease timecost for h264 encoding 8x 1920*1080@30Hz

The Xavier NX SoC is powerful to support 2x 4K60 | 4x 4K30 | 10x 1080p60 |
20x 108p30 (H.264) as Technical Specifications in Jetson Modules | NVIDIA Developer.

However, when I’s using following GStreamer pipeline to encode 8x 1080p30, it costs 38ms… And found its time cost largely increase from 10ms, 13ms, 14ms, 23ms, …, 38ms as 1 camera, 2 cameras, 3 cameras, 4 cameras, …, 8cameras.

const char *gst_cmd =
  "appsrc name=appsrc"
  " ! video/x-raw,format=YUY2,width=1920,height=1080,framerate=(fraction)30/1"
  " ! nvvidconv"
    " ! video/x-raw(memory:NVMM),format=NV12,width=1920,height=1080,"
    " framerate=(fraction)30/1"
    " ! nvv4l2h264enc control-rate=constant_bitrate bitrate=24000000"
     * All IDR frame configuration
     *   all-iframe, self-implemented param
     *   insert-sps-pps is needed
     * maxperf-enable: time-cost configuration
    " all-iframe=true insert-sps-pps=true maxperf-enable=true"
    " ! appsink name=appsink";

Besides, I have also tried the 60fps configuration, all 30/1 to 60/1, and the timecost seems no change…

PS: We had tried How can I customize to use non-blocking mode nvv4l2h264enc and it work worse; We’re trying Jetpack 4.4 [L4T 32.4.3] customize nvpmodel to make NVENC from 499.2MHz to 729.6MHz.

It is capability of hardware encoder and you can achieve the performance by running gstreamer command like:
How can I customize to use non-blocking mode nvv4l2h264enc - #8 by DaneLLL

For using OpenCV there is additional memory copy and it may dominate the performance. Also in multi-thread case somehow the CPU cores are not fully loaded. Seems like the multithreading is not efficient in OpenCV.

  1. The cost time of your demo is also unstable…
  2. How about the 60fps?

We are able to see steady fps. You may enable hardware converter at max clock and try again:
Nvvideoconvert issue, nvvideoconvert in DS4 is better than Ds5? - #3 by DaneLLL

The capability is listed in

h264 and h265 encoding can achieve 10x 1080p60

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.