In my original post theres a function called "sws_scale" which takes the original video frame that is in whatever format, usually YUV I think, and then converts it into another frame with a format I specify. As you can see I specified PIX_FMT_RGB24 as my format to convert to. Which according to the comments in the ffmpeg header it is this.. "// Packed RGB 8:8:8, 24bpp, RGBRGB..."
The raw RGB data is stored in pFrameRGB->data and.. pFrameRGB->linesize I think is the "pitch". Theres not much documentation unfortunately, only this shoddy doxygen:
http://cekirdek.pardus.org.tr/~ismail/ffmpeg-docs/structAVPicture.html#92fce3ff225b920a33c1ad866f4008cb
Btw I've tried doing a similar approach to the SaveFrame function but it doesnt seem to produce the right results.. just a random garbled image..
BYTE* pTextureData = (BYTE *)lockedRect.pBits;for(int y=0; y < pCodecCtx->height; y++)memcpy(pTextureData + y*lockedRect.Pitch, pFrameRGB->data[0]+y*pFrameRGB->linesize[0], pCodecCtx->width*4);
EDIT:
I've managed to get it working using the code above. It took a bit but I had to go through and get all the formats from ffmpeg matching the texture formats of directx. My only problem now is the image is upside down heh.
Cheers for your help guys.
[Edited by - Shael on February 14, 2008 8:30:52 PM]