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