JetPack5.1.1 does not support H265 GDR decoding

Hello:
I can decode the GDR of H265 on Jetpack 4.6, but not on Jetpack 5.1.1. The attachment is my H265 file for testing.
H265View.h265 (3.1 MB)
The command I used is:
gst-launch-1.0 filesrc location=H265View.h265 ! h265parse ! nvv4l2decoder enable-frame-type-reporting=1 ! nv3dsink -e

Jetson orin shows log:
nvidia@ubuntu:~/Raveneye_WIFI/build$ gst-launch-1.0 filesrc location=H265View.h265 ! h265parse ! nvv4l2decoder enable-frame-type-reporting=1 ! nv3dsink -e
Setting pipeline to PAUSED …
Opening in BLOCKING MODE
Pipeline is PREROLLING …
NvMMLiteOpen : Block : BlockType = 279
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 279
NvMMLiteNVMEDIADecSetAttribute:: Error status reporting set to 1
ERROR: from element /GstPipeline:pipeline0/nvv4l2decoder:nvv4l2decoder0: No valid frames decoded before end of stream
Additional debug info:
gstvideodecoder.c(1140): gst_video_decoder_sink_event_default (): /GstPipeline:pipeline0/nvv4l2decoder:nvv4l2decoder0:
no valid frames found
ERROR: pipeline doesn’t want to preroll.
Setting pipeline to NULL …
Freeing pipeline …

Hi,
Thanks for reporting this. We will replicate the issue and investigate.

Hi,
Please apply the patch to gst-v4l2 and rebuild/replace libgstnvvideo4linux2.so:

diff --git a/gst-v4l2/gstv4l2videodec.c b/gst-v4l2/gstv4l2videodec.c
index cb2ed29..e88f8ef 100644
--- a/gst-v4l2/gstv4l2videodec.c
+++ b/gst-v4l2/gstv4l2videodec.c
@@ -241,6 +241,7 @@ enum
   PROP_ENABLE_ERROR_CHECK,
   PROP_ENABLE_MAX_PERFORMANCE,
   PROP_OPEN_MJPEG_BLOCK,
+  PROP_IS_GDR_STREAM,
 /*Properties exposed on dGPU only*/
   PROP_CUDADEC_MEM_TYPE,
   PROP_CUDADEC_GPU_ID,
@@ -391,6 +392,11 @@ gst_v4l2_video_dec_set_property_tegra (GObject * object,
       self->v4l2output->open_mjpeg_block = g_value_get_boolean (value);
       break;
 
+    case PROP_IS_GDR_STREAM:
+      self->is_gdr_stream = g_value_get_boolean (value);
+      self->enable_frame_type_reporting = g_value_get_boolean (value);
+      break;
+
     case PROP_CAP_BUF_DYNAMIC_ALLOCATION:
       self->cap_buf_dynamic_allocation = g_value_get_enum (value);
       break;
@@ -518,6 +524,10 @@ gst_v4l2_video_dec_get_property_tegra (GObject * object,
       g_value_set_boolean (value, self->v4l2output->open_mjpeg_block);
       break;
 
+    case PROP_IS_GDR_STREAM:
+      g_value_set_boolean (value, self->is_gdr_stream);
+      break;
+
     case PROP_CAP_BUF_DYNAMIC_ALLOCATION:
       g_value_set_enum (value, self->cap_buf_dynamic_allocation);
       break;
@@ -1418,8 +1428,9 @@ gst_v4l2_video_dec_handle_frame (GstVideoDecoder * decoder,
    * a frame. In case of RTSP inputs we drop the DELTA units which are not
    * decodable independently until we receive I / IDR frame.
   */
-  if ((GST_V4L2_PIXELFORMAT(obj) == V4L2_PIX_FMT_H264) ||
-          (GST_V4L2_PIXELFORMAT(obj) == V4L2_PIX_FMT_H265))
+  if (((GST_V4L2_PIXELFORMAT(obj) == V4L2_PIX_FMT_H264) ||
+          (GST_V4L2_PIXELFORMAT(obj) == V4L2_PIX_FMT_H265)) &&
+          self->is_gdr_stream == FALSE)
   {
       if ((GST_BUFFER_FLAG_IS_SET (GST_BUFFER_CAST(frame->input_buffer),
                                   GST_BUFFER_FLAG_DELTA_UNIT)) &&
@@ -2240,6 +2251,12 @@ gst_v4l2_video_dec_class_init (GstV4l2VideoDecClass * klass)
             "Enable max performance", "Set to enable max performance",
             DEFAULT_MAX_PERFORMANCE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
+    g_object_class_install_property (gobject_class, PROP_IS_GDR_STREAM,
+        g_param_spec_boolean ("is-gdr-stream",
+            "is-gdr-stream",
+            "Whether or not the H264/H265 stream is GDR stream",
+            FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
     g_object_class_install_property (gobject_class, PROP_CAP_BUF_DYNAMIC_ALLOCATION,
       g_param_spec_enum ("capture-buffer-dynamic-allocation",
           "Enable capture buffer dynamic allocation",
diff --git a/gst-v4l2/gstv4l2videodec.h b/gst-v4l2/gstv4l2videodec.h
index 97cc58a..d50e47a 100644
--- a/gst-v4l2/gstv4l2videodec.h
+++ b/gst-v4l2/gstv4l2videodec.h
@@ -86,6 +86,7 @@ struct _GstV4l2VideoDec
   gboolean enable_frame_type_reporting;
   gboolean enable_error_check;
   gboolean enable_max_performance;
+  gboolean is_gdr_stream;
   guint32 cudadec_mem_type;
   guint32 cudadec_gpu_id;
   guint32 cudadec_num_surfaces;

It add a property is-gdr-stream. Please set the property while decoding H264/H265 GDR streams.

The source code of gst-v4l2 is in
https://developer.nvidia.com/embedded/jetson-linux-r3531

Driver Package (BSP) Sources

1 Like

Thanks. Will this bug be updated in the next Jetpack version?

Hi,
The patch doesn’t catch next Jetpack 5.1.2. Since it is open source, please also apply the patch once 5.1.2 is released.

1 Like

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