This is from a few years ago, hopefully it still works!
(It does make assumptions on pixel order, using PixelRGB would be a much better, but hopefully it gives you a start)
if(img_convert_ctx == NULL) { int w = outputWidth; int h = outputHeight; img_convert_ctx = sws_getContext(w, h, pCodecCtx->pix_fmt, w, h, OUTPUTFORMAT, SWS_BILINEAR, // SWS_BICUBIC -- doesn't take aspect into consideration... NULL, NULL, NULL); if(img_convert_ctx == NULL) { fprintf(stderr, "Cannot initialize the conversion context!\n"); exit(1); } } // put into RGB Frame... int ret = sws_scale(img_convert_ctx, (const uint8_t* const*)pFrame->data, pFrame->linesize, 0, outputHeight, pFrameRGB->data, pFrameRGB->linesize); jassert(ret>0); Image anImage(Image::ARGB,outputWidth, outputHeight,false); Image::BitmapData bmData(anImage,0,0,outputWidth, outputHeight,Image::BitmapData::readWrite); for(int y=0; y<outputHeight; y++) { uint8* juceImage=bmData.getLinePointer(y); uint8* srcPtr=pFrameRGB->data[0]+y*pFrameRGB->linesize[0]; for (int x=0;x<outputWidth;x++) { #if JUCE_BIG_ENDIAN // argb juceImage[0]=0xff; juceImage[1]=srcPtr[0]; juceImage[2]=srcPtr[1]; juceImage[3]=srcPtr[2]; #else // bgra juceImage[0]=srcPtr[2]; juceImage[1]=srcPtr[1]; juceImage[2]=srcPtr[0]; juceImage[3]=0xff; #endif juceImage +=bmData.pixelStride; srcPtr+=3; } }