<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr">avpicture_fill is not filling in the linesize or data as expected. I could really use some help here.<div><br></div><div>See the following:<br><div><br></div><div><div>AVFrame *output_frame = avcodec_alloc_frame();</div>

<div>   </div><div>output_size = avpicture_get_size(AV_PIX_FMT_YUV420P,</div><div>                                               640,</div><div>                                               480);</div><div><br></div><div>

uint8_t *output_buffer = (uint8_t*)av_malloc(output_size);<br></div><div><br></div><div>avpicture_fill((AVPicture*)output_frame,</div><div>                   output_buffer,</div><div>                   AV_PIX_FMT_YUV420P,</div>

<div>                   640,</div><div>                   480);</div></div></div><div><br></div><div>... later ...</div><div><br></div><div>sws_scale(...);</div><div><br></div><div>Outputs: [swscaler @ 0x912dd60] bad dst image pointers<br>

</div><div><br></div><div>Thanks for your time!</div><span class=""><font color="#888888"><div>-Neil</div></font></span></div>
<br>_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br>
<br></blockquote></div><br></div><div class="gmail_extra" style>Hi,</div><div class="gmail_extra" style><br></div><div class="gmail_extra" style>have you tried to call</div><div class="gmail_extra" style><br></div><div class="gmail_extra" style>
avpicture_alloc(&outPic, m_codecCtxOut->pix_fmt, m_codecCtxOut->width, m_codecCtxOut->height)<br></div><div class="gmail_extra"><br></div><div class="gmail_extra" style>That should set the data[] and linesize[] fields, and allocate the memory accordingly, afaik.</div>
<div class="gmail_extra" style><br></div><div class="gmail_extra" style>-Bjoern</div><div class="gmail_extra" style><br></div><div class="gmail_extra" style><br></div></div>