I'm attempting to convert from an RGB24 to 8bpp grayscale image, code as
follows:
convert_ctx = sws_getContext(pCodecCtx->width,
pCodecCtx->height, pCodecCtx->pix_fmt /* input format */,
pCodecCtx->width, pCodecCtx->height, PIX_FMT_RGB24 /* output format
? */,
0, NULL, NULL, NULL);
sws_scale(convert_ctx,
pFrame->data, pFrame->linesize,
0, pCodecCtx->height, /* src slice */
pFrameRGB->data, pFrameRGB->linesize);
My problem is that with the above parameters my nice color image becomes a
vertically squeezed grayscale (by 1/3). Can someone share what are the right
parameters to use to get a correctly sized grayscale image? I tried playing
around with some of the filter parameters, but couldn't get the right result.
Any help appreciated.
Rgds,
Andrew Sak
andrew_wm_sak at yahoo dot com
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user