The QuickTime Extension allows you to interact with and create images for importing from webcams and movie files.
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.
C:\Program Files\QuickTime\QTSystem\QTJava.zip
into
the extension directory and rename it QTJava.jar
.
lib
in the QTJ extension
directory, then create a directory called Windows
inside
lib
.
C:\Program
Files\QuickTime\QTSystem\QTJavaNative.dll
and C:\Program
Files\QuickTime\QTSystem\QTJNative.dll
into the Windows
directory.
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 have trouble, see Contacting Us.)
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.
A few files from your QuickTime installation need to be moved into the extension directory in order for the video extension to work.
/System/Library/Java/Extensions/QTJava.zip
into the
extension directory and rename it QTJava.jar
.
lib
in the QTJ extension
directory, then create a directory called Mac OS X
inside
lib
.
/System/Library/Java/Extensions/libQTJNative.jnilib
into the Mac OS X
directory.
Also, on 64-bit Macs (which includes all currently sold models), you will need to change NetLogo to run in 32-bit mode in order to use the extension. If you don't, the usual result is a java.lang.UnsatisfiedLinkError dialog. Here are the steps to follow:
If you want, you can make a copy of the application first and performs these steps on the copy, so the original still opens in 64-bit mode. (64-bit mode is the recommended default unless you are using this extension.)
The QuickTime Extension is not compatible with Linux, because Apple does not have a Linux version of QuickTime.
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 code examples that present the basic functions of these extensions.
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
Returns an image from the currently open camera suitable for importing with the bitmap extension
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
.
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
.
Closes the connected camera. You should always stop the camera before exiting NetLogo or before opening a new model.
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.
Returns an image of the current frame of the open movie suitable for importing with the bitmap extension.
Loads the specified movie at the specified resolution (given in patches).
Opens a window where you can view the open movie.
Changes the frame of the movie to the frame corresponding to the given time.
Starts playing the movie.
Stops playing the movie.