Nvv4l2decoder does not allow to use decodebin if the RTSP stream is not in the right format (I420)

Please provide complete information as applicable to your setup.

• Hardware Platform (RTX 3080 Laptop GPU)
• DeepStream Version: 6.3
• Ubuntu 20.04

Summary

I encountered an issue related to nvv4l2decoder, that I noticed it is automatically by decodebin called when reading an RTSP Input Stream in a GStreamer pipeline.

I noticed that if the input stream from the RTSP Server (a ZED Camera in my case) is in I420 format, the RTSP I/O pipeline from deepstream_python_apps runs smoothly

gst-zed-rtsp-launch zedsrc camera-fps=30 camera-resolution=5  ! videoconvert ! 'video/x-raw, format=(string)I420' ! x264enc tune=zerolatency speed-preset=ultrafast bitrate=3000 ! rtph264pay pt=96 name=pay0

Otherwise if called with another format:

gst-zed-rtsp-launch zedsrc camera-fps=30 camera-resolution=5  ! videoconvert ! 'video/x-raw' ! x264enc tune=zerolatency speed-preset=ultrafast bitrate=3000 ! rtph264pay pt=96 name=pay0

It fails with:

Error String : Feature not supported on this GPUError Code : 801
Error: gst-resource-error-quark: Failed to process frame. (1): gstv4l2videodec.c(2273): gst_v4l2_video_dec_handle_frame (): /GstPipeline:pipeline0/GstBin:source-bin-00/GstURIDecodeBin:uri-decode-bin/GstDecodeBin:decodebin0/nvv4l2decoder:nvv4l2decoder0:
Maybe be due to not enough memory or failing driver

As an additional source of information I get on the server terminal this message:

x264 [error]: baseline profile doesn't support 4:4:4

Current investigation*

I tried several different solutions, but the key is that so far I have not found a good way to convert an RTSP Input Stream from one format to another.
nvvideoconvert does work with the Usb Camera Demo, but as my speculation, it seems there is something in the RTSP handling that leads to the issue in this case.

I explored all these related issues, without success:

For 3080(Ampere), h264@yuv444 decoding is not supported.In H264 we support yuv444 encoding only.

Since we support lossless encoding/decoding in H265, you may consider use H265.

Or you could try changing the encoder input to yuv420 like you did in your first command line

@junshengy thanks for your reply!

Or you could try changing the encoder input to yuv420 like you did in your first command line

Would it be possible to perform some software decoding from let’s say YUV444 to YUV420 with GStreamer?
Like having a RTSP Input source from my original input in YUV444, converting and then forwarding to YUV420, so that then the rest of the pipeline succeeds?

You can do this. Since nvv4l2decoder sets the highest rank, when using uridecodebin, nvv4l2decoder will be used by default. Build the pipeline as follows and you can use software decoding.

gst-launch-1.0 rtspsrc location="rtsp stream with h264@yuv444" ! application/x-rtp, media=video, encoding-name=H264 ! queue ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! 'video/x-raw, format=(string)I420' ! nvvideoconvert ! video/x-raw"(memory:NVMM)",format=NV12 ! nveglglessink

Many thanks @junshengy for your reply! It’s been super useful, I managed to solve the issue!

This time works, but just for completeness I would like to ask why I still see on the RTSP Server Terminal

x264 [error]: baseline profile doesn't support 4:4:4

Is it like it is kind of seeing that YUV444, although decodebin this timee does not crash anymore because of conversion of the “converter node”?

This is a limitation of the 264 specification. If you want to encode y444, use the high profile, as shown below.

x264enc .... ! 'video/x-h264,profile=(string)high-4:4:4' ! ....

Just because avdec_h264 software decoding is used

Thanks again!

Just because avdec_h264 software decoding is used

So if I use avdec_h264 software decoding, it works even with RGB/YUV444, though it “complains” about it, because its conceived to deal with “YUV420”?

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