[FFmpeg-devel] extract and change pixels of AVFrame

Mehdi Hosseini mehdi.hoseini at gmail.com
Thu Sep 3 03:13:14 CEST 2015


Hello,

I want to do some pixel operations on a decoded frame (AVFrame structure)
in function "ff_thread_decode_frame" of the file
"ffmpeg/libavcodec/pthread.c".

For example. I wrote a simple code to get y,u,v of the pixel(0,0) :

int x= 0;
int y= 0;
 unsigned char y = picture->data[0][picture->linesize[0]*y + x];
 unsigned char u = picture->data[1][picture->linesize[1]*y + x];
 unsigned char v = picture->data[2][picture->linesize[2]*y + x];
 av_log(avctx, AV_LOG_WARNING,"\n ** ** %c %c **",y, u,v);

but it doesn't work. any suggestion how to access and change a specified
pixel?


More information about the ffmpeg-devel mailing list