Video input [message #80094] |
Sun, 06 May 2012 14:43 |
David Grier
Messages: 35 Registered: July 2010
|
Member |
|
|
Dear Folks,
Given that IDL has no native capabilities for reading video data, I
thought it might be useful to use open-source software to enable
frame-by-frame video input without requiring users to build libraries.
The result works for me, and may be useful for others in the community.
It can be downloaded under the terms of the GPL at
http://physics.nyu.edu/grierlab/software/dgggrmplayer__defin e.pro
The movie reader is an object called DGGgrMPlayer, which uses
software from the mplayer project to read frames out of a file.
It can read any video source supported by mplayer.
This allows me to analyze video data without first having to rip
the videos to frames, thereby saving disk space and time.
To play a movie called "mymovie.avi":
IDL> movie = dgggrmplayer("mymovie.avi")
IDL> screen = image(movie.next)
IDL> while ~movie.eof do screen.putdata, movie.next
movie.next is the next video frame in the movie
movie.eof is a flag that is true at the end of the movie
The object also can cast a movie to greyscale, can flip it (/order) and
can scale it to desired dimensions.
The documentation explains basic usage and requirements.
Suggestions, bug reports and bug fixes are warmly solicited.
All the best,
David
|
|
|