[smpeg] Extracting images

Ryan C. Gordon icculus at clutteredmind.org
Sat Apr 5 17:46:26 EST 2003

> is there an open source opengl sample program ?
> nothing big though cuz i want to look into using smpeg for in-game movies,
> like cut-scenes.

Look at "glmovie.c" in the smpeg distro.

> > Hi - I'm trying to read in a MPEG File and extract it into a whole heap
> > of .bmp files.  At the moment I can get it playing onto the screen, but I
> > can't seem to find anything that would allow me to get the pixels out of a
> > frame.

If you aren't using YUV hardware acceleration (use SMPEG_setdisplay() to
point it at an offscreen surface in RBG format), then you can look at the
linear framebuffer by using the SDL_surface's "pixels" field:

If you want to show each frame to the screen AND read the decoded bits:


Again, this ONLY works if you aren't using a YUV-accelerated surface.

And for OpenGL surfaces, render a frame and use glReadPixels() to get it.
You'll have to flip the image yourself, but that's trivial.


More information about the smpeg mailing list