About "control-rate" of omxh264enc and nvv4l2h264enc

I’m currently using JetsonTX2/R32.2.1/Jetpack 4.2.2.

I found a issue that “control-rate” does not work properly when I execute the following GStreamer command.

gst-launch-1.0 nvarguscamerasrc timeout=10 !
‘video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080,
format=(string)NV12, framerate=(fraction)30/1’ ! nvvidconv !
‘video/x-raw(memory:NVMM), format=(string)I420’ ! nvv4l2h264enc control-rate=1 bitrate=262144 ! h264parse ! qtmux ! filesink location=test.mp4 -e

At this time, if you darken or brighten the room
The size of test.mp4 changes a lot.

Does anyone know why the amount of data cannot be fixed?
This has the same issue with omxh264enc.
And the NVIDIA development kit also has this issue.

Also, since I have already made a product using R32.2.1,
It’s difficult to use the new Jetpack from now on.

I would like to use R32.2.1 to solve this issue.

Hi,
You may apply this patch and try again:
How to use H.264/5 control-rate with GStreamer? - #7 by DaneLLL

The source code of gst-v4l2 is in
https://developer.nvidia.com/embedded/dlc/r32-2-1_Release_v1.0/TX2-AGX/sources/public_sources.tbz2

Thank you for your reply.

I have tried your patch
The issue did not improve.

Does this patch also apply to omxh264enc?
Both omxh264enc and nvv4l2h264enc did not improve the issue.

Hi,
Please refer to this post and configure vbv-size:
Random blockiness in the picture RTSP server-client -Jetson TX2 - #5 by DaneLLL

Thank you for your reply.

Please refer to this post and configure vbv-size :

bitrate=512kbps(512*1024=524288)
FPS:30

gst-launch-1.0 nvarguscamerasrc timeout=10 !
‘video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080,
format=(string)NV12, framerate=(fraction)30/1’ ! nvvidconv !
‘video/x-raw(memory:NVMM), format=(string)I420’ ! nvv4l2h264enc ratecontrol-enable=1 control-rate=1 bitrate=524288 vbv-size=20000 ! h264parse ! qtmux ! filesink location=test.mp4 -e

I set vbv-size but it didn’t fix the issue.
The file size changes greatly depending on whether the room is bright or dark.

Hi,
It looks similar to
Constant Bitrate help - #12 by DaneLLL
500kbps is too harsh for 1080p30. Hardware encoder cannot encode insuch low nitrate when scene changes or scene is complicated. Suggest set bitrate to a larger value.

1 Like

Hi DaneLLL

500kbps is too harsh for 1080p30.
Hardware encoder cannot encode insuch low nitrate when scene changes or scene is complicated. Suggest set bitrate to a larger value.

Thank you for your support.
I understand that it is a problem of the bit rate and image size used.