Question on H264/H265 encoding configuration

Dear Nvidia Jetson Experts,

Following my previous question about the CPU consumption in case of multiple H264/H265 recording and streaming over the network (via v4l2loopback devices), I would like to have another question/confirmation regarding the number of encoders of the Xavier NX with following test-cases:

a. Only recording, no streaming (i.e. 1x 4K encoder + 3x 1080p encoders or 4x 4K encoders (!?!?!?) for recording to MP4 files) → works well (i.e. recorded framerates reach expected value which is 30) for the 4x v4l2loopback cloned devices even there’s a 4K encoding,

b. Recording & streaming with only 1080p resolution (i.e. 4x 1080p encoders for recording to MP4 files and 4x 1080p encoders for streaming over the network) → works well (i.e. recorded framerates reach expected value which is 30),

c. Mix of 4K and 1080p recording while only 1080p streaming (i.e. 1x 4K encoder + 3x1080p encoders for recording to MP4 files and 4x 1080p encoders for streaming over the network) → does NOT work well, especially the frame-rate of the 4K recording is often less than expected (~20fps to 24fps) and sometime it causes the framerate of other recording decreased.

It looks like in the c) case, 4K encoding configuration had to be used (for the recording of 4K) therefore the total number of the encoders (8) exceeded the number of 4K encoders (4x 4K30).

Do you think above observation is coherent with the spec of Jetson Xavier NX in terms of encoding configuration which is : 2x 4K60 (H.265) | 4x 4K30 (H.265) | 10x 1080p60 (H.265) | 22x 1080p30 (H.265) ?

Thanks and best regards,
Khang

Hi,
In module data sheet, the capability of encoder is to do encoding only, such as the gstreamer pipeline … ! nvv4l2h265enc ! fakesink sync=0. Since you see performance drop in streaming, the bottleneck may be in CPU capability or network bandwidth. The date rate of 4K stream is significant and it may take significant CPU usage and network bandwidth to stream it out.

For a try, please reduce bitrate of the 4K stream and see if it can achieve target frame rate.

Hi @DaneLLL,

Thanks for your prompt reply.

In our case, what we could see was the framerate of the recording including the 4K video, we haven’t measured the framerate of the stream over the network yet. And all the streams over the network were with 1080p30.

For a try, please reduce bitrate of the 4K stream and see if it can achieve target frame rate.

Do you have any recommendation for the suitable bitrate of a 4K video to keep its quality especially for the recording ? I used bitrate=4Mbps with control-rate=constant in my setup.

Thanks and regards,
Khang

Hi,
Please try CBR + setting virtual buffer size:
Random blockiness in the picture RTSP server-client -Jetson TX2 - #5 by DaneLLL
To find out a setting which balances between bitrate and video quality.

And here is a method for reducing CPU usage of K5.10:
UDP client CPU utilization has increased on Jetpack 5 - #6 by SanjayD

Please try and see if it helps the use-case.

1 Like

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