[FFmpeg-devel] extract and change pixels of AVFrame

Paul B Mahol onemda at gmail.com
Thu Sep 3 10:54:51 CEST 2015


Dana 3. 9. 2015. 03:13 osoba "Mehdi Hosseini" <mehdi.hoseini at gmail.com>
napisala je:
>
> 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?

Where is code ? What exactly does not work?
Your case above works only for yuv444p format.

> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


More information about the ffmpeg-devel mailing list