Oy… I only have my source files, and I’m not sure how well to make
it understandable without putting too much text on the mailing list.
There really isn’t a tutorial that I know of for using the OpenGL.
Actually, what you can do is once you’ve gotten the image data
decoded (as in the tutorial I linked to before):
avcodec_decode_video( mVideoCodecCtx, mVideoFrameYUV, &frameFinished,
pkt.data, pkt.size );
I convert each frame to RGB (they’re decoded to YUV for every video
format I’ve used) like so:
sws_scale( mSwsCtx, mVideoFrameYUV->data, mVideoFrameYUV->linesize,
0, mVideoCodecCtx->height, mVideoFrameRGB->data, mVideoFrameRGB-
linesize );
(This code is copied from my project, so I apologize if the variable
names aren’t helpful. I try my best, and if you check the ffmpeg
Doxygen for the functions you can probably figure them out. If not
let me know off-list and I’ll see if I can go into greater depth then.)
Then I use the mVideoFrameRGB->date value to upload as a sub-texture
to OpenGL using this function:
void VE_gcnMoviePane::setData( GLuint *d ) {
glBindTexture(GL_TEXTURE_2D, mTexNumber);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0,
mSubTexWidth, mSubTexHeight,
GL_RGB,
GL_UNSIGNED_BYTE, d);
}
Does that help? Anyway, we’ve lost the topic (SDL), so if you don’t
get it from this, let me know off-list. 
It seems like there should already be some kind of library that uses
ffmpeg to decode video to SDL… But maybe it’s simple enough that
wrapper libraries would just be excess overhead?
– ScottOn 2007/08/20, at 14:39, John M. wrote:
Scott,
Do you have a link to the example using OpenGL and textures?
thanks,
john
On 8/20/07, Scott Harper <@Scott_Harper> wrote:
I hope this will answer your question: it’s a link to a really great
tutorial (the section on decoding the video and drawing it to an
SDL_Surface), and is basically what I used when getting started with
ffmpeg.
Unfortunately I can’t help you more directly, because I use OpenGL
for the video in all my projects, and SDL only for well, everything
except the video.
So my program decodes the frame and uploads it
to a texture; and I have never used SDL for drawing so I don’t even
know how it works! >.>
Hopefully, the tutorial can help you out, or at least point you in
the right direction.
– Scott
On 2007/08/19, at 22:51, Jason wrote:
Hi all,
I’m wanting to incorporate a movie player kind of thing to play
some transition
movies within the game I’m writing.
…snip…
If anyone has had any success doing this kind of thing, can you
give me some
pointers on what to call from within RenderFrame? Is there a better
library than
ffmpeg for this?
TIA,
-J