访问每个像素的AVFrame [英] Access each Pixel of AVFrame
本文介绍了访问每个像素的AVFrame的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要访问FFMPEG的AVFrame对象的每个像素信息(如果它是RGB,则每个像素的每个颜色,R和G和B)
I need to access each pixel informations of an AVFrame object of FFMPEG ( If it's in RGB then each color, R and G and B of each Pixel )
推荐答案
如果你已经前进到正确的框架:
If you have already advanced to the correct frame - something like:
img_convert_ctx = ffmpeg::sws_getCachedContext(img_convert_ctx,w, h, pCodecCtx->pix_fmt, w, h, ffmpeg::PIX_FMT_RGB24, SWS_BICUBIC, NULL, NULL, NULL);
ffmpeg::sws_scale(img_convert_ctx, pFrame->data, pFrame->linesize, 0, pCodecCtx->height, pFrameRGB->data, pFrameRGB->linesize);
//Data is in pFrameRGB->data
这篇关于访问每个像素的AVFrame的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文