Page 1 of 1

RV1106 video encode mjpeg error

Posted: 2024-12-23 1:56
by mrlb
Hello,
Recently, I do some test about RV1106 video encode module and find some issues.

My target is use rv1106 video encode to get mjpeg video streaming. I find most of the jpeg
data is perfect, but after several seconds, I can get some bad frame. such as the below image:
Hope to get help.
The following configuration is detail video encode config:

Code: Select all

static RK_S32 venc_init(int chnId, int width, int height, RK_CODEC_ID_E enType) {
	printf("========%s========\n", __func__);
	VENC_RECV_PIC_PARAM_S stRecvParam;
	VENC_RC_PARAM_S stRcParam;
	VENC_CHN_ATTR_S stAttr;
	memset(&stAttr, 0, sizeof(VENC_CHN_ATTR_S));

	stAttr.stVencAttr.enType = enType;
	stAttr.stVencAttr.enPixelFormat = RK_FMT_YUV420SP;
	stAttr.stVencAttr.u32PicWidth = width;
	stAttr.stVencAttr.u32PicHeight = height;
	stAttr.stVencAttr.u32VirWidth = width;
	stAttr.stVencAttr.u32VirHeight = height;
	stAttr.stVencAttr.u32StreamBufCnt = 2;
	stAttr.stVencAttr.u32BufSize = width * height ;
	stAttr.stVencAttr.enMirror = MIRROR_NONE;
	stAttr.stRcAttr.enRcMode = VENC_RC_MODE_MJPEGFIXQP;
	stAttr.stRcAttr.stMjpegFixQp.u32Qfactor = 95;
	RK_MPI_VENC_CreateChn(chnId, &stAttr);
	stRcParam.stParamMjpeg.u32Qfactor = 95;
	RK_MPI_VENC_SetRcParam(chnId, &stRcParam);


	memset(&stRecvParam, 0, sizeof(VENC_RECV_PIC_PARAM_S));
	stRecvParam.s32RecvPicNum = -1;
	RK_MPI_VENC_StartRecvFrame(chnId, &stRecvParam);

	return 0;
}

Re: RV1106 video encode mjpeg error

Posted: 2024-12-23 3:52
by Crocodile
Hello, it is recommended to refer to the configuration options in <SDK>/media/samples/simple_test/simple_vi_bind_venc_jpeg.c or run simple_vi_bind_venc_jpeg on the board for testing.