Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Seeking help: video capture failures and crashes



In years past I've managed to implement an image processing application that performed video capture using QuickTime from C on Mac OS 9, but my efforts to do so in Java on Mac OS X have all failed. A stripped-down app illustrating the problem follows. The app not only doesn't work, but it has even crashed my machine (B&W G3 running Mac OS X 10.1.2) outright, requiring me to hit the reset button(!). Any help would be welcome.

I realize an obvious candidate for the source of the problem is the lack of a call to the settingsDialog() method on the video channel. Unfortunately, as has been documented previously on this list, that call is broken in the current version of OS X/QTJava. I have spent some time printing out the default settings of the video channel and found that it automatically configures itself for the FireWire DV digitizer I'm using (Dazzle Hollywood DV), so the broken settingsDialog() method doesn't appear to be a show-stopper in this case. (I've tried similar code under earlier versions of OS X and QTJava when settingsDialog() did work, and the results were the same.) (I have asked to be seeded with the version of QTJava in which the settingsDialog() bug is fixed, but haven't heard anything in response.)

Thanks in advance for any assistance.

-----Chris


public class FrameCaptureTest {

public static void main(String[] args) throws Exception {

QTSession.open();
System.out.println("QuickTime session opened.");

try {
SequenceGrabber SG = new SequenceGrabber();

System.out.println("Sequence grabber opened.");

try {
SGVideoChannel VidChan;

VidChan = new SGVideoChannel(SG);
VidChan.setUsage(StdQTConstants.seqGrabRecord);

// settingsDialog() doesn't work; a blank, unusable dialog appears.
// VidChan.settingsDialog();

VidChan.setFrameRate(30.0f);

SG.setGWorld(new QDGraphics(VidChan.getVideoRect()), null);
System.out.println("GWorld set.");

SG.setMaximumRecordTime(2 * 8); // Record eight frames.
System.out.println("Max record time set.");

SG.setDataOutput(new QTFile("../temp-test.mov"), StdQTConstants.seqGrabToDisk);
System.out.println("Data reference set.");

SG.prepare(false, true);
System.out.println("Sequence grabber prepared.");

SG.startRecord();
System.out.println("Recording started. Frame rate: " + VidChan.getFrameRate());

SG.idle();

do {
System.out.print('.');
} while (SG.idleMore());

System.out.println();

SG.stop();
System.out.println("Recording stopped.");

} finally {

SG.release();
SG.disposeQTObject();
System.out.println("Sequence grabber disposed.");
}

} catch (QTException e) {
e.printStackTrace();
} finally {

QTSession.close();
System.out.println("QuickTime sesssion closed.");
}
}
}


When that program runs, if it doesn't kill the machine, it generates the following output:


QuickTime session opened.
Sequence grabber opened.
GWorld set.
Max record time set.
Data reference set.
Sequence grabber prepared.
Recording started. Frame rate: 30.0
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
................

java has exited due to signal 10 (SIGBUS).




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.