Encoder does not support bt2020 formats

I’m on jetpack 35.3.1, and I’d love to encode bt2020 video. To show this functionality not working, I patched the encode example:

diff --git a/samples/01_video_encode/video_encode_csvparser.cpp b/samples/01_video_encode/video_encode_csvparser.cpp
index 0a05f17..22cc31d 100644
--- a/samples/01_video_encode/video_encode_csvparser.cpp
+++ b/samples/01_video_encode/video_encode_csvparser.cpp
@@ -781,8 +781,10 @@ parse_csv_args(context_t * ctx, int argc, char *argv[])
                          break;
                 case 2  :ctx->cs = V4L2_COLORSPACE_REC709;
                          break;
+                case 3  :ctx->cs = V4L2_COLORSPACE_BT2020;
+                         break;
             }
-            CSV_PARSE_CHECK_ERROR(!(num>0&&num<3),
+            CSV_PARSE_CHECK_ERROR(!(num>0&&num<4),
                     "Color space should be > 0 and < 4");
         }
         else if (!strcmp(arg, "-mem_type_oplane"))
diff --git a/samples/01_video_encode/video_encode_main.cpp b/samples/01_video_encode/video_encode_main.cpp
index e9fff62..7c981da 100644
--- a/samples/01_video_encode/video_encode_main.cpp
+++ b/samples/01_video_encode/video_encode_main.cpp
@@ -777,6 +777,9 @@ setup_output_dmabuf(context_t *ctx, uint32_t num_buffers )
                 cParams.colorFormat = ctx->enable_extended_colorformat ?
                     NVBUF_COLOR_FORMAT_YUV420_709_ER : NVBUF_COLOR_FORMAT_YUV420_709;
                 break;
+            case V4L2_COLORSPACE_BT2020:
+                cParams.colorFormat = NVBUF_COLOR_FORMAT_YUV420_2020;
+                break;
             case V4L2_COLORSPACE_SMPTE170M:
             default:
                 cParams.colorFormat = ctx->enable_extended_colorformat ?

and when i pass --color-space 3 it fails with:

NvMMLiteVideoEncDoWork:NvEncNvVicConvertSurfaceFormat failed
NvVideoEncTransferOutputBufferToBlock: DoWork failed line# 679 
NvVideoEnc: NvVideoEncTransferOutputBufferToBlock TransferBufferToBlock failed Line=690

it seems this should be a trivial addition considering it’s just a metadata bit?

Additionally, there are no ER bt2020 NVBUF_COLOR_FORMAT’s, that would also be a fantastic addition.

Hi,
Encoding bt2020 is not supported on current release. We will check if it is a hardware constraint.

And please note hardware VIC engine does not support ER bt2020. It is a hardware constraint.

Understood. I am not using the vic to produce my video.

It really shouldn’t be a hw constraint of the encoder considering it’s just metadata.

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