Capability of decoding on AGX Thor

Hi,

Can AGX Thor decode 4:2:2 8 or10bit bitstream?

I try to decode 4:2:2 H265, decoder returns error message.

./video_decode H265 test_nv16.h265

Set governor to performance before enabling profiler
Creating decoder in blocking mode
Opening in BLOCKING MODE
Setting frame input mode to 1
Starting decoder capture loop thread
Video Resolution: 1920x1080
[INFO] (NvEglRenderer.cpp:110) Setting Screen width 1920 height 1080
[ERROR] (NvVideoDecoder.cpp:131) Only NV12M, P010M, P012M, YUV420M, YUV422M, YUV444M, YUV444_10LE, NV24M and NV24_10LE is supported
Error in setting decoder capture plane format
Error in query_and_set_capture
Exiting decoder capture loop thread
[ERROR] (NvV4l2ElementPlane.cpp:179) Output Plane:Error while DQing buffer: Broken pipe
Error DQing buffer at output plane
Decoder is in error
App run failed

The data sheet indicates support for YUV422. Does it indicate the output color format rather than the encoded bitstream format?

Hi,
Please attach test_nv16.h265 so that we can replicate the error and check.

Hi Dane,

The uploaded bitstream is test clip.

Thank you.

test_nv16.zip (6.2 MB)

Hi Dane,

This is 4:2:2 10bit test clip.

Sample program also has the same error message to decode this clip.

test_yuv422_10le.zip (6.2 MB)

./video_decode H265 test_yuv422_10le.h265
Set governor to performance before enabling profiler
Creating decoder in blocking mode
Opening in BLOCKING MODE
Setting frame input mode to 1
Starting decoder capture loop thread
Video Resolution: 1920x1080
[INFO] (NvEglRenderer.cpp:110) Setting Screen width 1920 height 1080
[ERROR] (NvVideoDecoder.cpp:131) Only NV12M, P010M, P012M, YUV420M, YUV422M, YUV444M, YUV444_10LE, NV24M and NV24_10LE is supported
Error in setting decoder capture plane format
Error in query_and_set_capture
Exiting decoder capture loop thread
[ERROR] (NvV4l2ElementPlane.cpp:179) Output Plane:Error while DQing buffer: Broken pipe
Error DQing buffer at output plane
Decoder is in error
App run failed

Hi,
The gstreamer command works:

$ gst-launch-1.0 filesrc location= ~/test_nv16.h265 ! h265parse ! nvv4l2decoder ! nvvidconv ! video/x-raw,format=I420 ! xvimagesink

We will check why it does not work when running 00_video_decode sample.

Decoding YUV422 10-bit is not supported.

Hi,

Please apply below patch in /usr/src/jetson_multimedia_api

diff --git a/samples/00_video_decode/video_decode_main.cpp b/samples/00_video_decode/video_decode_main.cpp
--- a/samples/00_video_decode/video_decode_main.cpp
+++ b/samples/00_video_decode/video_decode_main.cpp
@@ -794,13 +794,15 @@
         capParams.height = crop.c.height;
         capParams.memtag = NvBufSurfaceTag_VIDEO_DEC;
 
-        if (format.fmt.pix_mp.pixelformat  == V4L2_PIX_FMT_NV24M)
+        if (format.fmt.pix_mp.pixelformat == V4L2_PIX_FMT_NV16M)
+          pix_format = NVBUF_COLOR_FORMAT_NV16;
+        else if (format.fmt.pix_mp.pixelformat == V4L2_PIX_FMT_NV24M)
           pix_format = NVBUF_COLOR_FORMAT_NV24;
-        else if (format.fmt.pix_mp.pixelformat  == V4L2_PIX_FMT_NV24_10LE)
+        else if (format.fmt.pix_mp.pixelformat == V4L2_PIX_FMT_NV24_10LE)
           pix_format = NVBUF_COLOR_FORMAT_NV24_10LE;
-        else if (format.fmt.pix_mp.pixelformat  == V4L2_PIX_FMT_YUV444)
+        else if (format.fmt.pix_mp.pixelformat == V4L2_PIX_FMT_YUV444)
           pix_format = NVBUF_COLOR_FORMAT_YUV444;
-        else if (format.fmt.pix_mp.pixelformat  == V4L2_PIX_FMT_YUV444_10LE)
+        else if (format.fmt.pix_mp.pixelformat == V4L2_PIX_FMT_YUV444_10LE)
           pix_format = NVBUF_COLOR_FORMAT_YUV444_10LE;
 
         if (ctx->decoder_pixfmt == V4L2_PIX_FMT_MJPEG)
diff --git a/samples/common/classes/NvBuffer.cpp b/samples/common/classes/NvBuffer.cpp
--- a/samples/common/classes/NvBuffer.cpp
+++ b/samples/common/classes/NvBuffer.cpp
@@ -411,6 +411,18 @@
             planefmts[0].bytesperpixel = 1;
             planefmts[1].bytesperpixel = 2;
             break;
+        case V4L2_PIX_FMT_NV16M:
+            *num_planes = 2;
+
+            planefmts[0].width = width;
+            planefmts[1].width = width / 2;
+
+            planefmts[0].height = height;
+            planefmts[1].height = height;
+
+            planefmts[0].bytesperpixel = 1;
+            planefmts[1].bytesperpixel = 2;
+            break;
         case V4L2_PIX_FMT_GREY:
             *num_planes = 1;
 
diff --git a/samples/common/classes/NvVideoDecoder.cpp b/samples/common/classes/NvVideoDecoder.cpp
--- a/samples/common/classes/NvVideoDecoder.cpp
+++ b/samples/common/classes/NvVideoDecoder.cpp
@@ -125,10 +125,11 @@
     NvBuffer::NvBufferPlaneFormat planefmts[MAX_PLANES] = {{0}};
 
     if (! ((pixfmt == V4L2_PIX_FMT_NV12M) || (pixfmt == V4L2_PIX_FMT_P010M) || (pixfmt == V4L2_PIX_FMT_P012M) ||
-           (pixfmt == V4L2_PIX_FMT_YUV422M) || (pixfmt == V4L2_PIX_FMT_NV24M) || (pixfmt == V4L2_PIX_FMT_NV24_10LE) ||
-           (pixfmt == V4L2_PIX_FMT_YUV420M) || (pixfmt == V4L2_PIX_FMT_YUV444) || (pixfmt == V4L2_PIX_FMT_YUV444_10LE) ))
+           (pixfmt == V4L2_PIX_FMT_NV16M) || (pixfmt == V4L2_PIX_FMT_YUV422M) || (pixfmt == V4L2_PIX_FMT_NV24M) ||
+           (pixfmt == V4L2_PIX_FMT_NV24_10LE) || (pixfmt == V4L2_PIX_FMT_YUV420M) || (pixfmt == V4L2_PIX_FMT_YUV444) ||
+           (pixfmt == V4L2_PIX_FMT_YUV444_10LE) ))
     {
-        COMP_ERROR_MSG("Only NV12M, P010M, P012M, YUV420M, YUV422M, YUV444M, YUV444_10LE, NV24M and NV24_10LE is supported");
+        COMP_ERROR_MSG("Only NV12M, P010M, P012M, YUV420M, NV16M, YUV422M, YUV444M, YUV444_10LE, NV24M and NV24_10LE is supported");
         return -1;
     }
 

After applying the patch, you could run commands to verify.

DISPLAY=:0 ./video_decode H265 ~/test_nv16.h265

Thanks