<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">that was my effort, because it didn't work too.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 30, 2019 at 7:24 PM Carl Eugen Hoyos <<a href="mailto:ceffmpeg@gmail.com">ceffmpeg@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">2019-04-30 13:34 GMT+02:00, hamidi <<a href="mailto:hamidi@gmail.com" target="_blank">hamidi@gmail.com</a>>:<br>
> Hi<br>
> In the following code, I can't figure out what's wrong:<br>
><br>
> uint8_t *dstData[4];<br>
> int dstLinesize[4];<br>
> AVPixelFormat convertToPixFmt = AV_PIX_FMT_RGBA;<br>
> int ret;<br>
><br>
> // ...<br>
><br>
> printf("tmp_frame format: %d (%s) %dx%d\n", tmp_frame->format,<br>
> av_get_pix_fmt_name((AVPixelFormat)tmp_frame->format), tmp_frame->width,<br>
> tmp_frame->height);<br>
> // The above line prints: tmp_frame format: 23 (nv12) 480x480<br>
><br>
> int size = av_image_get_buffer_size(convertToPixFmt, tmp_frame->width,<br>
> tmp_frame->height, 1);<br>
> uint8_t *buffer = (uint8_t *) av_malloc(size);<br>
><br>
> ret = av_image_copy_to_buffer(buffer, size,<br>
> (const uint8_t * const *)&tmp_frame->data[i],<br>
<br>
Why are you copying the temporary frame instead<br>
of passing its pointer to sws_scale()?<br>
<br>
Carl Eugen<br>
_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
<a href="https://ffmpeg.org/mailman/listinfo/libav-user" rel="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">libav-user-request@ffmpeg.org</a> with subject "unsubscribe".</blockquote></div>