[Libav-user] avpicture_fill

Bjoern Drabeck bjoern.drabeck at gmail.com
Wed Apr 24 07:14:11 CEST 2013


avpicture_fill is not filling in the linesize or data as expected. I could
> really use some help here.
>
> See the following:
>
> AVFrame *output_frame = avcodec_alloc_frame();
>
> output_size = avpicture_get_size(AV_PIX_FMT_YUV420P,
>                                                640,
>                                                480);
>
> uint8_t *output_buffer = (uint8_t*)av_malloc(output_size);
>
> avpicture_fill((AVPicture*)output_frame,
>                    output_buffer,
>                    AV_PIX_FMT_YUV420P,
>                    640,
>                    480);
>
> ... later ...
>
> sws_scale(...);
>
> Outputs: [swscaler @ 0x912dd60] bad dst image pointers
>
> Thanks for your time!
> -Neil
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
>
Hi,

have you tried to call

avpicture_alloc(&outPic, m_codecCtxOut->pix_fmt, m_codecCtxOut->width,
m_codecCtxOut->height)

That should set the data[] and linesize[] fields, and allocate the memory
accordingly, afaik.

-Bjoern
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20130424/7658d846/attachment.html>


More information about the Libav-user mailing list