[Libav-user] Avframe to iplimage

Bruno Gonzalez stenyak at gmail.com
Wed Aug 24 21:29:57 CEST 2011


I assume you mean opencv image format? The basic idea is something like
this:

avf2ipl(AVFrame * avf, IplImage * ipl)
    {
        if (swscontext == 0) swscontext = sws_getContext(context->width,
context->height, PIX_FMT_YUV420P, ipl->width, ipl->height, PIX_FMT_BGR24,
SWS_BILINEAR, 0, 0, 0);
        if (swscontext == 0) return;
        int linesize[4] = { ipl->widthStep, 0, 0, 0 };
        sws_scale(swscontext, avf->data, avf->linesize, 0, context->height,
(uint8_t **) & (ipl->imageData), linesize);
    }

On Wed, Aug 24, 2011 at 18:01, Rui Luís <rui.luis at gmail.com> wrote:

> Good day..
> i have been for 4 days trying to convert an avframe to an iplimage in my c
> project...
>
> can some one help me???
> ------
> Give a man a fish and you feed him for a day. Teach him how to fish and you
> feed him for a lifetime.
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
>


-- 
Saludos,
     Bruno González

_______________________________________________
Jabber: stenyak AT gmail.com
http://www.stenyak.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20110824/7b69a4f0/attachment.html>


More information about the Libav-user mailing list