Regarding H264, there are a large number of mosaics in the encoding at a bit rate of 2M and a resolution of 1920 * 1080

When using nvv4l2h264enc for encoding, a large number of mosaics will appear

When using x264enc for encoding, this issue will not occur

The following is the code for encoding

nvv4l2h264enc :
gst-launch-1.0 nvarguscamerasrc !
‘video/x-raw(memory:NVMM), width=(int)4000, height=(int)3000,
format=(string)NV12, framerate=(fraction)25/1’ !
nvvidconv !
‘video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080’ !
nvv4l2h264enc bitrate=2097152 maxperf-enable=1 idrinterval=25 !
h264parse ! ‘video/x-h264, stream-format=byte-stream, alignment=au’ !
filesink location=./filename_h264_nvv4l2h264enc -e

x264enc:
gst-launch-1.0 nvarguscamerasrc !
‘video/x-raw(memory:NVMM), width=(int)4000, height=(int)3000,
format=(string)NV12, framerate=(fraction)25/1’ !
nvvidconv !
‘video/x-raw, width=(int)1920, height=(int)1080’ !
x264enc bitrate=2048 key-int-max=25 ! ‘video/x-h264, profile=(string)baseline’ !
h264parse ! ‘video/x-h264, stream-format=byte-stream, alignment=au’ !
filesink location=./filename_h264_x264enc -e

h264_encode_video.zip (4.7 MB)

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

Check if there is improvement in video quality in the setup. 2Mbps is strict to 1920x1080p25 and there may still be mosaics in complex scenes.

Hello, according to the settings you provided, a large number of mosaics still appear after setting up

Using CBR mode

The following is a code example:
gst-launch-1.0 nvarguscamerasrc !
‘video/x-raw(memory:NVMM), width=(int)4000, height=(int)3000,
format=(string)NV12, framerate=(fraction)25/1’ !
nvvidconv !
‘video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080’ !
nvv4l2h264enc bitrate=2097152 vbv-size=160000 maxperf-enable=1 idrinterval=25 !
h264parse ! ‘video/x-h264, stream-format=byte-stream, alignment=au’ !
filesink location=./filename_h264_nvv4l2h264enc -e

Here is a video presentation:
filename_h264_nvv4l2h264enc.zip (3.6 MB)

Hello, according to the settings you provided, a large number of mosaics still appear after setting up

Using CBR mode

The following is a code example:
gst-launch-1.0 nvarguscamerasrc !
‘video/x-raw(memory:NVMM), width=(int)4000, height=(int)3000,
format=(string)NV12, framerate=(fraction)25/1’ !
nvvidconv !
‘video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080’ !
nvv4l2h264enc bitrate=2097152 vbv-size=160000 maxperf-enable=1 idrinterval=25 !
h264parse ! ‘video/x-h264, stream-format=byte-stream, alignment=au’ !
filesink location=./filename_h264_nvv4l2h264enc -e

Hi,
We think 2Mbps is too strict for 1080p30. Would suggest set bitrate to a larger value.

But my bandwidth is limited and I can only use 2M. Why does x264enc encoding not have a large number of mosaics while nvv4l2h264enc encoding has a lot of mosaics when profile=baseline.
I need a solution !!!

Hi,
This is constraint of hardware encoder since the bitrate is low. The quality may be poor in the condition. We suggest use the setup:

01_video_encode$ ./video_encode  a.yuv 1920 1080 H264 ./test.264 -br 2097152 --max-perf -ifi 2147483647 -idri 2147483647 --insert-spspps-idr -fps 25 1 -p main -hpt 3

Encode in main profile and medium hardware preset type.

Hello, our settings only support the setting of profile=baseline. Is there a way to solve this situation.

Hi,
This is constraint of hardware encoder. The bitrate is low and this is the quality hardware encoder can achieve.

For the particular use-case it may be better to use software encoder. To meet the requirement.

Is there a patch available? Or it could be improved in a higher version of Jetpack. Current environment Jetpack=4.6

Hi,
Please use software encoder x264enc in the low-bitrate use-case.

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