[Numpy-discussion] load movie frames in python?

Hans Meine meine@informatik.uni-hamburg...
Tue Jan 29 17:07:02 CST 2008

On Dienstag 29 Januar 2008, Brian Blais wrote:
> Is there a way to read frames of a movie in python?  Ideally,
> something as simple as:
> for frame in movie('mymovie.mov'):
>      pass
> where frame is either a 2-D list, or a numpy array?  The movie format
> can be anything, because I can probably convert things, but most
> convenient would be avi, mov, and flv (for youtube videos).

I'd look for Gstreamer python bindings.  Or run mplayer/mencoder with a "raw" 
format (e.g. yuv4mpeg or -ovc raw -vf format=bgr24/rgb15/...) using a pipe 
and processing the frames one by one. OK, that's no iterator-based interface 
yet, but one could probably hack that together in an hour or so.

Ciao, /  /                                                    .o.
     /--/                                                     ..o
    /  / ANS                                                  ooo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://projects.scipy.org/pipermail/numpy-discussion/attachments/20080130/55dc79c8/attachment.bin 

More information about the Numpy-discussion mailing list