[libav-api] Converting from Webcam/V4l2 capture data format (YUYV or UYVY)

Ronald S. Bultje rsbultje at gmail.com
Mon Jun 13 03:49:45 CEST 2011


On Sun, Jun 12, 2011 at 1:56 PM, Eric Glaser <eglaser2010 at gmail.com> wrote:
> Hi, I am having some trouble converting from YUYV to RGB format - it
> crashes in sws_scale.

Can you provide a backtrace?

>            int numRGBBytes = ww * hh * 4;   //src width * src height * 4
>            buffer = malloc (sizeof(uint8_t)*numRGBBytes);

Use av_malloc(), malloc() return values are not aligned and crash
randomly when using SIMD functions.

>        int ret = sws_scale(pOGLContext->img_convert_ctx,
> (uint8_t**)pFrame->data, pFrame->linesize, 0, hh, pFrameRGB->data,
> pFrameRGB->linesize);

So here it crashes? That's likely in the runtime-generated MMX code
then. Again, can you provide a backtrace, and then the output (in gdb)
"disass $pc-32,$pc+32" and "info all-registers".


More information about the libav-api mailing list