Code covered by the BSD License  

Highlights from
Simple Video Camera Frame Grabber Toolkit


4.0 | 1 rating Rate this file 52 Downloads (last 30 days) File Size: 81.4 KB File ID: #35554
image thumbnail

Simple Video Camera Frame Grabber Toolkit



A toolkit for capturing still frames from Firewire or USB video cameras

| Watch this File

File Information

(Version 0.8)

The FrameGrabM toolkit provides a quick way to grab still frames from a live video source, such as a FireWire video camera or a USB webcam. Individual video frames are returned to MATLAB as a matrix of RGB values. The toolkit uses LTI-CIVIL, a Java-based library instigated by Ken Larson for capturing images (see Please refer to the README file for instructions on how to download and install LTI-CIVIL.

Key features of FrameGrabM:
- Targeted for Windows, Mac OS X, and Linux x86 and x64
- No need for MATLAB Image Acquisition Toolbox
- Simultaneous capture from multiple video devices

It's easy! Here is an example MATLAB script for capturing a video frame from the default capture device:

    fgrabm_start % Initialize the framework and start capture
    pause(2) % Wait for the capture device to warm up
    pixels = fgrabm_grab(); % Grab the most recent frame and return data
    image(pixels) % Display the pixels
    fgrabm_shutdown % Uninitialize the capture framework

Please look at the README file for details on installation, as MATLAB's Java library path in its librarypath.txt and classpath.txt files must be configured to refer to included LTI-Civil native library files. Depending upon how MATLAB was installed, you may need administrative/root privileges to successfully perform these changes. README also contains special information pertaining to the Mac OS X platform.

Note that this is a preliminary release and I welcome feedback that can help lead to a final version. See README for more details.

Required Products MATLAB
MATLAB release MATLAB 7 (R14)
Other requirements See the README file for additional information.
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (7)
12 May 2014 imran


I am working on a project which consist to controlling two FireWire camera simultaneously, I tried to install your frame grabber kit but when I installed I have got an error message :

Unrecognized token, etc..

How do I install this kit for Matlab 64bit version ?

Kind regards

28 Mar 2014 Kenneth Perrine

Thomas, supposedly the underlying LTI-Civil library can capture from two cameras simultaneously. And I had seen it work! But, I have had experiences, too, where the computer freezes up when I capture two simultaneous images. The problem seems to worsen when the images being captured are higher resolution or the frame rate is higher. I suggest trying the following: 1. A faster computer; 2. Separate USB buses (e.g. install a separate USB controller and put one camera on that); 3. FireWire cameras instead of USB cameras; 4. Decreasing the resolution and/or the frame rate. I would like to know if any of these options work for you. Longer-term, I have had better experience with the OpenCV library and am considering updating the software to use that instead of LTI-Civil. Maybe that will help with the 64-bit Mac problems too?

28 Mar 2014 Kenneth Perrine

Zizhou and Brian, I have had troubles getting LTI-Civil to work with QuickTime video capture in 64-bit Mac/OS. I don't know if it is possible for the current system to actually work. Sorry I can't be of further help.

13 Mar 2014 Thomas

Hello. I am currently working on a project with stereovision on my university.
I have successfully downloaded and installed this toolkit you have made.
My question is, how is it possible for me to get a stereoscopic picture with this toolkit?
When "fgrabm_test" is called, I recive a picture from my integrated webcam(camera1), I can also change the default to USB webcam1(camera2) or USB webcam2(camera3) and get pictures from them,but only one bye one.
When I run the "sample_twocams" it starts running and Matlab is "busy" but Matlab runs forever and nothing will work and eventually Matlab is not responding to anything so I have to manually shut down Matlab.

For my project I need one picture from camera2 and camera3 taken
simultaneously, so I then can load the pictures to another Matlab script I have and do some tests.

Really hope you guys can be able to help me with this, much appreciated.

Best regards

04 Dec 2013 Zizhou

I got the following error when I run fgarbm_start

environment: maxos 64, matlab 2013b

>> fgrabm_start
java.lang.NoClassDefFoundError: Could not initialize class quicktime.QTSession
at quicktime.QTRuntimeException.toString(
at java.lang.String.valueOf(
at java.lang.StringBuilder.append(
at java.lang.Throwable.printEnclosedStackTrace(
at java.lang.Throwable.printStackTrace(
at java.lang.Throwable.printStackTrace(
at com.mathworks.jmi.OpaqueJavaInterface.getExceptionMessage(
Error using com.academiken.framegrabm.util.GrabCore/init
Failed to retrieve Exception Message

Error in fgrabm_init (line 35)

Error in fgrabm_start (line 14)

03 Jun 2013 Brian

I also tried changing to 32bits as you mention in the readme but then I am unable to startup matlab.

03 Jun 2013 Brian

First thank you for writing the code.
I just want to say I tried using it on Mac Osx (10.8.3) w/matlab 2013a and this is the error I get. It seems to have a problem with the native library however I am sure I followed the installation procedures correctly.

at java.awt.EventQueue.invokeAndWait(
at java.awt.EventQueue.invokeAndWait(
at quicktime.QTSession.<clinit>(
at com.lti.civil.impl.qtjava.QTCaptureSystem.init(
at com.academiken.framegrabm.util.GrabCore.init(
Caused by: java.lang.UnsatisfiedLinkError: /System/Library/Java/Extensions/libQTJNative.jnilib: no suitable image found. Did find: /System/Library/Java/Extensions/libQTJNative.jnilib: mach-o, but wrong architecture
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(
at java.lang.ClassLoader.loadLibrary(
at java.lang.Runtime.loadLibrary0(
at java.lang.System.loadLibrary(
at quicktime.QTSession$
at java.awt.event.InvocationEvent.dispatch(
at java.awt.EventQueue.dispatchEventImpl(
at java.awt.EventQueue.access$400(
at java.awt.EventQueue$
at java.awt.EventQueue$
at Method)
at java.awt.EventQueue.dispatchEvent(
at java.awt.EventDispatchThread.pumpOneEventForFilters(
at java.awt.EventDispatchThread.pumpEventsForFilter(
at java.awt.EventDispatchThread.pumpEventsForHierarchy(
at java.awt.EventDispatchThread.pumpEvents(
at java.awt.EventDispatchThread.pumpEvents(
Error using fgrabm_init (line 35)
Java exception occurred:
java.lang.UnsatisfiedLinkError: quicktime.QTSession.Gestalt(I[I)S
at quicktime.QTSession.Gestalt(Native Method)
at quicktime.QTSession.gestalt(

Error in fgrabm_test (line 12)

Contact us