GStreamer | nvv4l2h264enc qp-range show no change

Hi there
I’m using a Jetson Nano Developer Kit with Jetpack 4.5.1 (on the latest image from SDK-Manager),
I want to create a GStreamer pipeline that will be able to change quantization settings mid-stream,
gst-inspect show that nvv4l2h264enc cannot change the qp/b/i frame settings when pipeline is playing, only on null or ready state, however qp-range seems to be available to me while playing.

I’ve created a simply python POC that will launch the pipelines and once per minute - change the qp-range, I’m getting no error, and the script seems to be running fine, but there are no discernible changes in the video.

In order to ensure this I’ve tried starting the pipeline with different qp-range values, but there doesn’t seem to be any difference at all, am I missing something?
My pipelines:

videotestsrc is-live=true ! video/x-raw,width=1280,height=720,framerate=30/1 
! timeoverlay ! nvvidconv ! video/x-raw(memory:NVMM) ! nvv4l2h264enc 
! video/x-h264,stream-format=byte-stream ! h264parse ! rtph264pay config-interval=1 
! application/x-rtp,media=video,clock-rate=90000,encoding-name=H264,payload=96 
! udpsink host=127.255.255.255 port=5000 sync=false async=false

udpsrc port=5000 caps=application/x-rtp,media=video,clock-rate=90000,encoding-name=H264,payload=96 
! rtph264depay ! decodebin ! nvvidconv ! video/x-raw(memory:NVMM) 
! nvv4l2h264enc name=nvenc preset-level=0 iframeinterval=1 control-rate=0 insert-sps-pps=1 qp-range=50,51:10,35:10,35 
! video/x-h264,stream-format=byte-stream ! nvv4l2decoder ! nvvidconv ! xvimagesink sync=false async=false

I’ve tried every variation of ratecontrol-enable and control-rate, I’ve tried removing the iframeinterval,
using -1 as the rest of the qp-range values etc.

another issue I have is having to use decodebin instead of nvv4l2decoder, because that one just won’t work there, it doesn’t pass on any information.
But that doesn’t bother me as much.

Thing is, I couldn’t find any more information about nvv4l2h264enc’s qp-range anywhere but the gst-inspect,
The Accelerated GStreamer docs only show this options for the omx encoder
Is this a misdocumentation? I’m assuming if it were I’d receive an error of some sort

I’d appreciate any help,
Cheers^

Hi,
The qp-range property works in VBR mode. If you run the command:

$ gst-launch-1.0 videotestsrc num-buffers=30 ! nvvidconv ! nvv4l2h264enc name=nvenc preset-level=0 iframeinterval=1 control-rate=0 insert-sps-pps=1 qp-range=50,51:30,31:10,35 ! h264parse ! video/x-h264,stream-format=byte-stream ! filesink location=a.h264

Yo will see IDR/I frames have q value=31:

danel@ce-tw-daneliu:~/D/home/daneliu/temp/jm19.0$ ./JM/bin/ldecod.exe -i a.h264 Setting Default Parameters...
Parsing Configfile decoder.cfg

******************************************************
*               Decoder Parameters                   *
******************************************************
Parameter InputFile = a.h264
Parameter OutputFile = test_dec.yuv
Parameter RefFile = test_rec.yuv
Parameter WriteUV = 1
Parameter FileFormat = 0
Parameter RefOffset = 0
Parameter POCScale = 2
Parameter DisplayDecParams = 1
Parameter ConcealMode = 0
Parameter RefPOCGap = 2
Parameter POCGap = 2
Parameter Silent = 0
Parameter IntraProfileDeblocking = 1
Parameter DecFrmNum = 0
Parameter DecodeAllLayers = 0
Parameter DPBPLUS0 = 1
Parameter DPBPLUS1 = 0
******************************************************
----------------------------- JM 19.0 (FRExt) -----------------------------
 Input reference file                   : test_rec.yuv does not exist
                                          SNR values are not available
POC must = frame# or field# for SNRs to be correct
--------------------------------------------------------------------------
  Frame          POC  Pic#   QP    SnrY     SnrU     SnrV   Y:U:V Time(ms)
--------------------------------------------------------------------------
00000(IDR)        0     0    30                             4:2:0       3
00001( I )        2     1    31                             4:2:0       1
00002( I )        4     2    31                             4:2:0       1
00003( I )        6     3    31                             4:2:0       1
00004( I )        8     4    31                             4:2:0       1
00005( I )       10     5    31                             4:2:0       1
00006( I )       12     6    31                             4:2:0       1
00007( I )       14     7    31                             4:2:0       1
00008( I )       16     8    31                             4:2:0       1
00009( I )       18     9    31                             4:2:0       1
00010( I )       20    10    31                             4:2:0       1
00011( I )       22    11    31                             4:2:0       1
00012( I )       24    12    31                             4:2:0       1
00013( I )       26    13    31                             4:2:0       1
00014( I )       28    14    31                             4:2:0       1
00015( I )       30    15    31                             4:2:0       1
00016( I )       32    16    31                             4:2:0       1
00017( I )       34    17    31                             4:2:0       1
00018( I )       36    18    31                             4:2:0       1
00019( I )       38    19    31                             4:2:0       1
00020( I )       40    20    31                             4:2:0       1
00021( I )       42    21    31                             4:2:0       1
00022( I )       44    22    31                             4:2:0       1
00023( I )       46    23    31                             4:2:0       1
00024( I )       48    24    31                             4:2:0       1
00025( I )       50    25    31                             4:2:0       1
00026( I )       52    26    31                             4:2:0       1
00027( I )       54    27    31                             4:2:0       1
00028( I )       56    28    31                             4:2:0       1
00029( I )       58    29    31                             4:2:0       1
-------------------- Average SNR all frames ------------------------------
 SNR Y(dB)           :  0.00
 SNR U(dB)           :  0.00
 SNR V(dB)           :  0.00
 Total decoding time : 0.048 sec (625.000 fps)[30 frm/48 ms]
--------------------------------------------------------------------------
 Exit JM 19 (FRExt) decoder, ver 19.0
 Output status file                     : log.dec
30 frames are decoded.

The setting cannot be changed in PLAYING. You would need to stop the pipeline and re-trigger it with new setting.