Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The data I obtained is in AV_PIX_FMT_YUVJ422P format, how to convert it to YUV? #73

Open
hzhh110 opened this issue Jul 22, 2023 · 0 comments

Comments

@hzhh110
Copy link

hzhh110 commented Jul 22, 2023

The data I obtained is in AV_PIX_FMT_YUVJ422P format, how to convert it to YUV?

static void YUV420PPackages(uint8_t *yuv420, uint8_t *y_ptr, uint8_t *u_ptr,
uint8_t *v_ptr, int width, int height)
{
int yLen = width * height;
int uvLen = width / 2 * height / 2;
memcpy((unsigned char *)yuv420, y_ptr, yLen);
memcpy((unsigned char *)yuv420 + yLen, u_ptr, uvLen);
memcpy((unsigned char *)yuv420+yLen+uvLen, v_ptr, uvLen);
}
YUV420PPackages(buf, pVideoFrame->data[0], pVideoFrame->data[1], pVideoFrame->data[2], pCodecCtx->width, pCodecCtx->height);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant