On 05/04/2008, at 10:32 PM, Vicente Soriano wrote:

>
> Hi!
> I'm trying to make a program that changes the color of
> some pixels by another pixels (pixels from another video
> file, aka BlueScreening). I have started to use the
> libavcodec functions, but i cannot access to the color
> of the pixels. I guess it is in the "data" var of the "AVFrame"
> struct, but, i don't know how to change the value.

No, the data cvariable of AVFrame holds the compressed video frame,  
this is not what you want.

You will need to use the avcodec_decode_video call to get access to  
the pixel data.

The code would look something like this...

     while(av_read_frame(pFormatCtx, &packet)>=0)
     {
         // Is this a packet from the video stream?
         if(packet.stream_index==videoStream)
         {
             // Decode video frame
             avcodec_decode_video(pCodecCtx, pFrame, &frameFinished,
                 packet.data, packet.size);

             // Did we get a video frame?
             if(frameFinished)
             {


Mark
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to