Hello ImageJ folks,
I would like to share a small library for ImageJ for reading and writing video files. Why another video package? - I needed something *very* simple to pass on to my students.
This library reads and writes video files frame-by-frame under the control of a simple loop, using only a *single* ImageProcessor object. No callbacks or events are used, the library does not rely on stacks and thus has only modest memory requirements. Thus videos of arbitrary length (even HD formats) can be processed.
The library is implemented transparently in 2 versions - JMF and QuickTime -, which can be used alternatively or together. If only one version is used, the other package can be easily removed. Here is a typical code sequence using the QuickTime version to illustrate how a video file is read and processed frame by frame:
String path = "AppleQtSample.mov";
MovieReader mr = QtMovieReader.openMovie(path);
ImageProcessor ip = mr.createImageProcessor();
int frame;
while ((frame = mr.getNextFrame(ip)) >= 0) {
//process and/or display the frame contained in ip ...
}
mr.close();
Note that this is no production code but aims at Java plugin developers. Several example plugins are provided.
Currently the package is only tested under Windows XP (32 bits) - reports for other platforms and suggestions are welcome!
Download from:
http://staff.fh-hagenberg.at/burger/imagej/
Hope this is useful-
Wilhelm
www.imagingbook.com