QuickTime for Java Extension

What does the QuickTime for Java Extension do?

The QuickTime for Java Extension allows you to interact with and create images for importing from webcams and movie files.

Installing the QuickTime for Java Extension

Windows

First, make sure you have QuickTime installed if you don't you can download it here:

http://www.apple.com/quicktime/download/

A few files from your Quicktime installation need to be moved into the extension directory in order for the video extension to work.

You will also need to install a digitizer, we recommend WinVDIG which can be downloaded here:

http://www.eden.net.nz/7/20071008/

You must install version 1.0.1 not a newer version.

You can then test that QTJ and the digitizer are installed correctly through their test application QTCap. If you are having trouble with this installation please contact feedback@ccl.northwestern.edu

On Windows Vista you will need to start NetLogo as administrator in order to use the video extension. You can do so by right clicking on the executable and selecting "Run As Administrator". You can also permanently change this setting: open the properties dialog, select the Compatibility tab and select "Run As Administrator" checkbox.

Mac OS X

A few files from your Quicktime installation need to be moved into the extension directory in order for the video extension to work.

Linux

The QuickTime for Java Extension is not compatible with Linux, because Apple does not have a Linux version of QuickTime.

Getting started

To import images from webcams and movies into NetLogo you will need to include both the QTJ and the Bitmap Extensions.

extensions[ bitmap qtj ]

There are two example models in the extensions/qtj directory, one for movies (movie.nlogo) and one of webcams (iSight.nlogo). These present the basic functions of these extensions.

Primitives

qtj:camera-image qtj:camera-select qtj:camera-start qtj:camera-stop qtj:movie-close qtj:movie-image qtj:movie-open qtj:movie-open-player qtj:movie-set-time qtj:movie-start qtj:movie-stop

qtj:camera-image

qtj:camera-image

Returns an image from the currently open camera suitable for importing with the bitmap extension

qtj:camera-select

qtj:camera-select width height

Offers a dialog of installed cameras for you to choose from. When you select one a connection is opened with the selected camera at the given resolution. If you use camera-select you do not need to call camera-start. You must call either select or start before using camera-image.

qtj:camera-start

qtj:camera-start width height

Opens the connected camera at the given resolution (given in patches) and prepares it to grab images. You must always call camera-start or camera-select before using camera-image. You should not use camera-start when the camera is already open. To select a different camera use camera-stop then camera-select.

qtj:camera-stop

qtj:camera-stop

Closes the connected camera. You should always stop the camera before exiting NetLogo or before opening a new model.

qtj:movie-close

qtj:movie-close

Closes the currently open movie, disposes of any related resources including the player window. You should always close a movie before opening a new one or before exiting NetLogo.

qtj:movie-image

qtj:movie-image

Returns an image of the current frame of the open movie suitable for importing with the bitmap extension.

qtj:movie-open

qtj:movie-open width height

Loads the specified movie at the specified resolution (given in patches).

qtj:movie-player

qtj:movie-open-player

Opens a window where you can view the open movie.

qtj:movie-set-time

qtj:movie-set-time seconds

Changes the frame of the movie to the frame corresponding to the given time.

qtj:movie-start

qtj:movie-start

Starts playing the movie.

qtj:movie-stop

qtj:movie-stop

Stops playing the movie.