How can I get the IDR and SPS to come from nvv4l2h264enc together?

Please provide complete information as applicable to your setup.

**• Hardware Platform (GPU)
**• DeepStream Version (6.2)
**• TensorRT Version (8.5.2-1+cuda11.8)
**• NVIDIA GPU Driver Version (535.54.03)
**• Issue Type( questions)

I am implementing the ability to do h264 encoding via jetson board and dGPU and then send it to RTSP.
On the jetson orin side, when encoding through nvv4l2h264enc, an IDR NAL unit (type 5) is created along with SPS and PPS NAL units.
On the dGPU side, non-IDR frames (type 1) are always followed by SPS and PPS NAL units.
I don’t know if it’s related, but the nvv4l2h264enc plugin on the jetson side has options called idrinterval and insert-sps-pps, while the dGPU side doesn’t have these options.
In order to get the H.264 stream as RTSP and not break the video when playing it back, I want it to look at the NAL type and start decoding if it’s 5, but I can’t seem to catch this 5 type.
Is there any way to do this on the dGPU side as well as the jetson side of the encoding?

what is your device model? I can’t reproduce this issue, there is IDR after SPS and PPS. here is the test command:
gst-launch-1.0 videotestsrc ! video/x-raw,format=RGBA ! nvvideoconvert ! ‘video/x-raw(memory:NVMM),format=I420’ ! nvv4l2h264enc bitrate=1000000 ! filesink location=test.264
could you share the reproducing step and output video? thanks!

Thank you for your response.
I got the test.264 file using the command you suggested and checked it with the hex editor.
First of all, I noticed that the first occurrence of SPS is followed by the IDR type.
However, from the subsequent SPS, the type 1 continues to appear.

On the jetson board, SPS does not occur periodically when I execute the command you suggested, so I tested it with the following command.

gst-launch-1.0 videotestsrc ! video/x-raw,format=RGBA ! nvvideoconvert ! 'video/x-raw(memory:NVMM),format=I420' ! nvv4l2h264enc idrinterval=30 insert-sps-pps=true bitrate=1000000 ! filesink location=test2.264

In this case, the SPS is followed by a NAL unit of type 5 continuously.

I would like to get the same result on the dGPU the way it is encoded on the jetson board, is there any way?

There is no update from you for a period, assuming this is not an issue any more. Hence we are closing this topic. If need further support, please open a new one. Thanks.
thanks for the sharing. on GPU, there is no nvv4l2h264enc 's idrinterval parameter in DS6.2. we have fixed this issue internally. Please also follow our version updates. Thanks.

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