[Libav-user] Swscale bad dst image pointers

Dorian Green doriangreen97 at gmail.com
Mon Nov 25 07:01:55 EET 2019


Set alignment to 1. I also made a separate avframe named gl_frame and
renamed the first to av_frame, change swscale to use "av_frame" and
"gl_frame" as dst but still received "bad dst image pointers" any other
ideas?

On Sun, Nov 24, 2019, 5:53 PM gga <ggarra13 at gmail.com> wrote:

>
>
> On 20/11/19 03:19, Dorian Green wrote:
>
> Hello, can someone enlighten me as to why this gives error -22 "invalid
> argument" which results in bad dst image pointers?
>
> ------------------------------------------------------
>
> AVFrame * frame = av_frame_alloc();
> If (!frame){
>
> std::cout << "frame failed to initialize" << std::endl;
>
> }
>
> Int size =
> av_image_get_buffer_size(pCodecContext->pix_fmt,pCodecContext->width,pCodecContext->height,0);
>
> auto picture_src = (uint8_t*)av_malloc(sizeof(uint8_t) * size);
>
> av_image_fill_arrays(frame->data,frame->linesize,picture_src,
> pCodecContext->pix_fmt,pCodecContext->width,pCodecContext->height,0);
>
> You might want to set the alignment to 1, just in case.
>
>
> sws_scale(img_convert_ctx, frame->data,frame->linesize,0,
> pCodecContext->height,frame->data,frame->linesize);
>
> ----------------------------------------------------
> What is it that i'm not understanding?
>
>
> You are using sws_scale to decode to the same pointers it is reading
> from.  That's more likely your problem.
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/libav-user
>
> To unsubscribe, visit link above, or email
> libav-user-request at ffmpeg.org with subject "unsubscribe".
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20191124/fbb533fc/attachment.html>


More information about the Libav-user mailing list