[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] How to decode MPEG=?koi8-r?Q?=3F?=



From: Gary Herron
Date: Wed, 4 Aug 2004 11:13:55 -0700
Subject: [pygame] How to decode MPEG?

> 
> I've got a Python/PyOpenGL application that now needs to display some
> MPEG video streams. The project was not written with PyGame (although
> I'd now like to borrow Guido's time machine and change that decision),
> but is it possible to use PyGame's MPEG decoding ability in some kind
> of stand-alone library-ish way to get the decoded pixels frame-by-frame.
> 
> I've got all the machinery necessary to periodically drop the pixels
> of a frame into a OpenGL texture being mapped into my scene.  All I
> need is a way to get the pixels of successive frames at appropriate
> times. 
> 
> The Movie class is too high a level since it presumes all sorts of
> PyGame setup and control of the screen, but is there a lower level API
> to the decoding software?
> 
> Thanks,
> Gary Herron

You can use pymedia to demux/parse the frames, convert them to surface/RGB/BMP/PNG and display or do whatever you need( see examples in the tar ball )
I believe pygame 1.7 will have Overlay object where you can display data directly from pymedia.

http://pymedia.sourceforge.net
Dmitry/