<p><br>
On Jul 12, 2012 6:30 PM, "Alexandre Millette" <<a href="mailto:amillett@matrox.com">amillett@matrox.com</a>> wrote:<br>
><br>
> Hello all.<br>
><br>
> I'm working on a C++ video player using libav.<br>
> Upon testing with various video formats and files, I've encountered a problem with a small MPEG4/mp4v file (190x240).<br>
> The issue is that a small green band (6 px in width) will appear on the right side of the frames.<br>
><br>
> This is what I've gathered so far:<br>
> - The YUV420 frame read in the stream is ok.<br>
> - The RGB32 frame output by sws_scale (there is no resize, the function is used only for conversion purpose) has the green band, so the problem comes from sws_scale.<br>
> - The green color comes from the original allocation of the YUV frame (data to 0 equals to a green shade).<br>
> - If sws_scale is used also as a resizing device (say converting YUV420 190x240 to RGB32 191x240), there is no colored band, but the frame is of course 1 pixel wider than intended (frame accuracy is an important feature of the project, so this is not acceptable).</p>

<p>I believe your problem could be rooted in bicubic transform. It makes n9 sense when source and target sizes are the same. Try to set linear.</p>
<p>> img_convert_ctx = sws_getContext(w, h, PIX_FMT_YUV420P,<br>
>   w, h, PIX_FMT_RGB32, SWS_BICUBIC, NULL, NULL, NULL);<br>
><br>
> Thank you,<br>
> Alex M</p>
<p>I hope this helps.<br>
Alex</p>