TX2 L4T Multimedia Issues

I have used l4t sdk & multimedia r32.1 on tx2.
The samples of h.264/h.265 could run for the pix_format YUV420.

But the format of my bitstream is YUYV. After I modified “video_encode_main.cpp” and then compiled it:

// setup_output_dmabuf(context_t *ctx, uint32_t num_buffers)
        if (ctx->enableLossless && ctx->encoder_pixfmt == V4L2_PIX_FMT_H264)
        {
            cParams.colorFormat = NvBufferColorFormat_YUV444;
        }
        else
        {
//	            cParams.colorFormat = ctx->enable_extended_colorformat ?
//	                 NvBufferColorFormat_YUV420_ER : NvBufferColorFormat_YUV420;
	            cParams.colorFormat = NvBufferColorFormat_YUYV;
        }

// Set encoder output plane format
    if (ctx.enableLossless && ctx.encoder_pixfmt == V4L2_PIX_FMT_H264)
    {
        ctx.profile = V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_PREDICTIVE;
        ret =
            ctx.enc->setOutputPlaneFormat(V4L2_PIX_FMT_YUV444M, ctx.width,
                                      ctx.height);
    }
    else
    {
        ret =
//            ctx.enc->setOutputPlaneFormat(V4L2_PIX_FMT_YUV420M, ctx.width,
            ctx.enc->setOutputPlaneFormat(V4L2_PIX_FMT_YUYV, ctx.width,
                                      ctx.height);
    }

I got the error(seeing attachment) after executed:

./video_encode ../../data/Video/my_video.yuv 1280 727 H265 ../../data/Video/my_video.h264

Hi,
Hardware encoder on TX2 supports YUV420/NV12 formats. YUV444 and YUV422 are not supported.

Thank you for your reply.

Hi, Dane

In the 01_video_encode sample, there is no QP value, only the maximum & minimum QP values in struct context_t.
So, I have some questions:

Is the QP value is dynamic adaptive during encoding?
And what are the default values for the following parameters?
uint32_t nMinQpI;              /* Minimum QP value to use for index frames */
uint32_t nMaxQpI;              /* Maximum QP value to use for index frames */
uint32_t nMinQpP;              /* Minimum QP value to use for P frames */
uint32_t nMaxQpP;              /* Maximum QP value to use for P frames */
uint32_t nMinQpB;              /* Minimum QP value to use for B frames */
uint32_t nMaxQpB;              /* Maximum QP value to use for B frames */

Hi,

Yes. Bit rate algorithm decides the value for each frame.

Default setting is in /etc/enctune.conf