<div dir="auto">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? </div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Nov 24, 2019, 5:53 PM gga <<a href="mailto:ggarra13@gmail.com">ggarra13@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <p><br>
    </p>
    <br>
    <div>On 20/11/19 03:19, Dorian Green wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="auto">Hello, can someone enlighten me as to why this
        gives error -22 "invalid argument" which results in bad dst
        image pointers?
        <div dir="auto"><br>
        </div>
        <div dir="auto">------------------------------------------------------<br>
          <div dir="auto"><br>
          </div>
          <div dir="auto">AVFrame * frame = av_frame_alloc();</div>
          <div dir="auto">If (!frame){</div>
          <div dir="auto"><br>
          </div>
          <div dir="auto">std::cout << "frame failed to
            initialize" << std::endl;</div>
          <div dir="auto"><br>
          </div>
          <div dir="auto">}</div>
          <div dir="auto"><br>
          </div>
          <div dir="auto">Int size =
av_image_get_buffer_size(pCodecContext->pix_fmt,pCodecContext->width,pCodecContext->height,0);</div>
          <div dir="auto"><br>
          </div>
          <div dir="auto">auto picture_src =
            (uint8_t*)av_malloc(sizeof(uint8_t) * size);</div>
          <div dir="auto"><br>
          </div>
          <div dir="auto">av_image_fill_arrays(frame->data,frame->linesize,picture_src,<span style="font-family:sans-serif">pCodecContext->pix_fmt,</span><span style="font-family:sans-serif">pCodecContext->width,</span><span style="font-family:sans-serif">pCodecContext->height,0);</span></div>
          <div dir="auto"><font face="sans-serif"><br>
            </font></div>
        </div>
      </div>
    </blockquote>
    You might want to set the alignment to 1, just in case.<br>
    <blockquote type="cite">
      <div dir="auto">
        <div dir="auto"><br>
          <div dir="auto"><font face="sans-serif">sws_scale(img_convert_ctx,
              frame->data,frame->linesize,0,</font><span style="font-family:sans-serif">pCodecContext->height,frame->data,frame->linesize);</span></div>
          <div dir="auto"><font face="sans-serif"><br>
            </font></div>
          <div dir="auto"><font face="sans-serif">----------------------------------------------------</font></div>
          <div dir="auto"><font face="sans-serif">What is it that i'm
              not understanding?</font></div>
        </div>
      </div>
    </blockquote>
    <br>
    You are using sws_scale to decode to the same pointers it is reading
    from.  That's more likely your problem.<br>
    <br>
  </div>

_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank" rel="noreferrer">Libav-user@ffmpeg.org</a><br>
<a href="https://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer noreferrer" target="_blank">https://ffmpeg.org/mailman/listinfo/libav-user</a><br>
<br>
To unsubscribe, visit link above, or email<br>
<a href="mailto:libav-user-request@ffmpeg.org" target="_blank" rel="noreferrer">libav-user-request@ffmpeg.org</a> with subject "unsubscribe".</blockquote></div>