Understanding NvENC parameters, benchmarks & bitrate results when using nvm_iep_sci

Please provide the following info (tick the boxes after creating this topic):
Software Version
DRIVE OS 6.0.8.1
DRIVE OS 6.0.6
DRIVE OS 6.0.5
DRIVE OS 6.0.4 (rev. 1)
DRIVE OS 6.0.4 SDK
other

Target Operating System
Linux
QNX
other

Hardware Platform
DRIVE AGX Orin Developer Kit (940-63710-0010-300)
DRIVE AGX Orin Developer Kit (940-63710-0010-200)
DRIVE AGX Orin Developer Kit (940-63710-0010-100)
DRIVE AGX Orin Developer Kit (940-63710-0010-D00)
DRIVE AGX Orin Developer Kit (940-63710-0010-C00)
DRIVE AGX Orin Developer Kit (not sure its number)
other

SDK Manager Version
1.9.3.10904
other

Host Machine Version
native Ubuntu Linux 20.04 Host installed with SDK Manager
native Ubuntu Linux 20.04 Host installed with DRIVE OS Docker Containers
native Ubuntu Linux 18.04 Host installed with DRIVE OS Docker Containers
other

Hi NVIDIA Team,

I am hoping to understand in the NvENC benchmarks (MPix/s & Max cumulative bitrate). Currently, my setup is to encode 3-4 4K videos @ 30 fps, using HEVC (h265), either on the HP or UHP setting with the sample application nvm_iep_sci. I am getting some results and hoping to get some clarification to get a better understanding.

Results
Encoding 4 different streams simultaneously using .yuv files of 4k resolution (100 frames / file), using UHP default settings, constant QP @ QP32, I am getting an average of 70 fps across 4 videos, with varying average bitrates of 60Mbps to 105Mbps (sample output from nvm_iep_sci below). Based on the benchmarks we got from NVIDIA (separate from the one below but using it as a reference), the cumulative bitrate should be somewhere in the order of 155Mbps for UHP of 3x 4k@30fps videos. However, if we were to sum the average / minimum bitrate of the 4 videos, it is well over 200Mbps which is much higher than the maximum cumulative bitrate.

Additionally, if I were to encode 3 different streams using Constant Bitrate and specifying the RCAverageBitrate parameter = 50Mbps, I am getting an average 60fps across 3 streams, and an average bitrate of 150Mbps. Summing all 3 streams bitrate puts the bitrate well over the maximum cumulative bitrate.

Questions

  1. Is my understanding of maximum cumulative bitrate correct - maximum cumulative bitrate / no. of streams = desired average bitrate per stream? How does this benchmark number come into use when trying to encode the streams (is it used only in a certain encoding setting)?
  2. For the other benchmark number of MPix/s, how does it come into use when trying to encode the streams?
  3. What is the encoding (quality?) difference between HQ, HP & UHP setting? We see that the default config files main difference is H265EncPreset, but it seems like the number of streams that NvENC can guarantee a 4k@30fps encoding differs significantly when changing the setting.
  4. What is the EPFrameRateNum/Den parameter used for - is it only useful for actual camera streams? How do you specify the output frame rate of the encoded streams (.hevc) files?

Thanks in advance!

Retrieved from NVIDIA Jetson AGX Orin Series datasheet
image

Sample output from nvm_iep_sci

Dear @samuel.ongzx,
This forum is exclusively for developers who are part of the NVIDIA DRIVE™ AGX SDK Developer Program. To post in the forum, please use an account associated with your corporate or university email address.
This helps us ensure that the forum remains a platform for verified members of the developer program.
Thanks.

Hi @SivaRamaKrishnaNV thanks for letting me know. I have updated my email address to my corporate email address. Should I continue this question in this thread or should I post another with my updated email address?

Dear @samuel.ongzx,
Just trying to understand your test. You ran 4 instances of sample with different input video? Could you share the config files?

The perf numbers(Mpix/s and Max cumulative numbers) came from running wide range of tests on contents of varied complexities and a range of bitrates.
Note that Jetson Orin NVENC frequency is different from DRIVE Orin. The perf numbers needs to be scaled accordingly.

For different types of encoding quality, please seehttps://developer.nvidia.com/docs/drive/drive-os/6.0.8.1/public/drive-os-linux-sdk/api_reference/group__x__image__encode__api.html#ga4c3ff348635d525887be959c28fab776

Hi @SivaRamaKrishnaNV thanks for the reply!

Yeap, I ran 4 instances of the sample (through a shell script) simultaneously to encode 4 different input videos (.yuv) files. I have attached the H265_UHP.cfg file that I have, and the command that I used to run the sample app.

Thanks for the explanation. Do you happen to have a typical test result that you could share so we could determine whether our tests is similar to real world average results?

Lastly, is there a deeper explanation that I could find on the difference between the different type of encoding quality than just low, medium, high?

Thanks!
Sam

Config File:
H265_UHP.txt (16.5 KB)

Shell command:

#!/bin/bash
WIDTH=3840
HEIGHT=2160

OUT=$2
CONFIG=./config/H265_UHP.cfg

./nvm_iep_sci \
	-cf $CONFIG -fsl 0 \
	-alternateCreateAPI 0 \
	-p InputFile=$FILE InputFileFormat=0 OutputFile=$OUT \
	EPEncodeWidth=$WIDTH EPEncodeHeight=$HEIGHT \
	FramesToBeEncoded=0 \
	-profile 0 \
	-v 3 \
	$3

Hi @SivaRamaKrishnaNV pinging again to see if you could assist with my questions!

Thanks!

The intent of the maximum cumulative bitrate mentioned in the spec is to give an approximate of overall throughput support for given presets
The way to read this data is: For N number of streams running on a chip, the cumulative bitrates of N streams should be < maximum cumulative bitrate to achieve real time performance. Desired bitrate per stream really depends on user and their use case. We only comment on the sum and not individual rates

In NVENC we support 3 defined presets; HQ, HP, UHP; Users can set those as per their use cases
HQ – High quality (suggested for high latency use cases – with B-frames)
HP – High Performance, Ideal for low latency but has throughput of around 0.5 times of UHP but will give better quality compared to UHP preset
UHP – Ultra High Performance; Ideal to use in low latency and where highest possible throughput is required

I don’t have benchmarking perf numbers. Jetson AGX Orin has 998MHz and DRIVE Orin has 883Mhz. I would expect the perf numbers to scale as per the frequency. Could you share your noticed values for different configuration to check with core team if it is expected.

Thanks for the response @SivaRamaKrishnaNV!

We are able to encode 4x 4k streams at UHP at mid quality settings which is sufficient for our use case. We also got a better understanding of what the spec meant after your explanation. Thanks again for the detailed explanation and response!

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