We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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?
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);
The text was updated successfully, but these errors were encountered:
No branches or pull requests
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);
The text was updated successfully, but these errors were encountered: