Hi All,

I am trying to convert from YUV420P to RGB24 with /sws_scale/. The source video is from an AVI file, via /avcodec_decode_video2()/. I get a segmentation fault every time, and am at a complete loss. If anyone can suggest anything I would be greatly appreciative. I have followed various tutorials and looked at many different examples. I am sure it's a simple mistake I'm making. My /sws_getContext()/ Call is as follows:

swsC = sws_getContext(    pCodecCtx->width,    //    Source width
pCodecCtx->height, // Source height //pFrame->pict_type, // Source format (maybe PIX_FMT_YUV420P) pCodecCtx->pix_fmt, // Source format (maybe PIX_FMT_YUV420P) pCodecCtx->width, // Dest width pCodecCtx->height, // Dest height PIX_FMT_RGB24, // Dest format SWS_FAST_BILINEAR+SWS_PRINT_INFO, // Transform Type (choose from SWS FLAGS) NULL, NULL, NULL); // Filters & Pointer Setup (NULL chooses defaults for last 3 options)

After checking /swsC/ this is used directly in the /sws_scale()/ call, as follows:

sws_scale( swsC, // SwsContext - Setup for scaling (const uint8_t* const*) pFrame->data, // Source frame data (cast to required type) pFrame->linesize, // Source frame stride 0, // Source frame slice width (raster, so no width slicing) pCodecCtx->height, // Source frame slice height nFrame->data, // Dest frame data nFrame->linesize); // Dest frame stride

In the above line(s), I get the SEG fault - every time.

Any pointers (no pun intended) would be greatly received. Full Program Listing, here: http://www.ee.ucl.ac.uk/~zceed42/gs.html <http://www.ee.ucl.ac.uk/%7Ezceed42/gs.html>

Thanks, Regards,
George Smart.
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to