Video input for IDL on Macs [message #80547] |
Mon, 18 June 2012 06:44  |
David Grier
Messages: 35 Registered: July 2010
|
Member |
|
|
Dear Folks,
I've been working on an IDL object that reads images frame-by-frame from
video files. This complements IDL's capabilities for video output, and
(greatly) extends the video input capabilities of the IDLffMJPEG2000
object to work with any video source rather than just mjpeg files.
My object works flawlessly on linux systems, but is giving me trouble
under MacOS. The object's source code is freely available at
http://physics.nyu.edu/grierlab/software/dgggrmplayer__defin e.pro
I'm hoping that an interested colleague might help me get this up
and running on MacOS as well. Here's the idea:
1. Use SPAWN to open the video source with mencoder,
the open-source video translation program.
2. Have mencoder write the video frame-by-frame to a
named pipe (a fifo) as raw video data.
3. Read each the raw video data from the fifo into IDL using READU.
Benefits of this approach include (1) being able to read any video
format recognized by mplayer/mencoder (2) without having to build any
additional external libraries.
The problem under MacOS is that frames are truncated -- only a few video
lines make the trip through the fifo in any frame. I'm guessing that
there's some buffer size that I need to set somewhere somehow.
For the life of me, I can't find the solution. Can you?
All the best,
David
|
|
|
Re: Video input for IDL on Macs [message #81387 is a reply to message #80547] |
Sat, 08 September 2012 04:53  |
David Grier
Messages: 35 Registered: July 2010
|
Member |
|
|
Dear Folks,
I found the bug. Now it's possible to read frames from video files on both
linux and MacOS systems. The video-reading object spawns standard installations
of mplayer and mencoder to transcode just about any video file into raw video frames
and to write the frames one at a time to a named pipe (fifo). It then uses
native IDL commands to read frames from the fifo. No DLL.
The code for the video-reading object is available for download under the GPL at
http://physics.nyu.edu/grierlab/software/dgggrmplayer__defin e.pro
The next challenge is to get this thing to read frames from cameras.
Suggestions are warmly invited.
TTFN,
David
|
|
|