ffmpeg里yuv格式以及各种8~10bits的定义在pixfmt.h里。
转换大概方法,
拿format索引
av_pix_fmt_desc_get(dstFormat)
设定输入输出格式
dstContext = sws_getContext(srcW, srcH, srcFormat, dstW, dstH, dstFormat,
flags, NULL, NULL, NULL);
然后用转换
sws_scale(dstContext, (const uint8_t * const*)src, srcStride, 0, srcH, dst, dstStride);
转换大概方法,
拿format索引
av_pix_fmt_desc_get(dstFormat)
设定输入输出格式
dstContext = sws_getContext(srcW, srcH, srcFormat, dstW, dstH, dstFormat,
flags, NULL, NULL, NULL);
然后用转换
sws_scale(dstContext, (const uint8_t * const*)src, srcStride, 0, srcH, dst, dstStride);
细节没仔细看,有兴趣可以细看swscale-test.c