Mailing Lists: Apple Mailing Lists

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

Re: Seeking help: video capture failures and crashes



So this may not be an ideal resolution....

You typically CAN NOT set a seqeuence grabber to an offscreen Gworld = which
your call to tokenGWorld is doing.

Many video digitizers basically collapse under the pressure of having to
blit to main memory...

So - that is why our SG code sets everything up after the window is visible
and your code should do the same...

That said - the fact that this hoses the machine is not good. It is a bug
that QT would have to fix. It would be extremely helpful if you could
describe your configuration etc and the resulting crash (with a copy of your
app) into the bug base - details are at:
http://developer.apple.com/bugreporter

Is the URL I think

Bill

on 10/1/02 12:10 PM, Chris W. Johnson wrote:

> At 2:50 PM +1100 1/10/02, dean perry wrote:
>> a few things about this line:
>>
>> SG.setGWorld(new QDGraphics(VidChan.getVideoRect()), null);
>>
>>
>> you _must_ set the SG gworld _before_ making the video channel on
>> OSX and Windows - to the valid scratch gworld is good enough - but
>> better if your actual GWorld...
>>
>> this is not something that was ever an issue on Mac OS < X but blows
>> up immediately on OS X when you create the video channel...
>
> Thanks for the advice, Dean. I've altered my code accordingly, but
> the behavior hasn't changed; it still never actually records a movie,
> and occasionally it crashes Mac OS X (not very UNIX- or Java-like
> behavior). The revised test code is as follows:
>
>
> import java.awt.*;
> import java.util.*;
> import quicktime.*;
> import quicktime.io.*;
> import quicktime.qd.*;
> import quicktime.std.comp.*;
> import quicktime.std.movies.*;
> import quicktime.std.movies.media.*;
> import quicktime.std.StdQTConstants;
> import quicktime.std.sg.*;
> import quicktime.util.*;
>
>
> 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 {
>
> // Ensure that some GWorld - any GWorld - is set before creating
> // the video channel. This is reported to avoid a bug present in
> // QuickTime for Windows and Mac OS X, but not present in Mac OS.
>
> QDGraphics TokenGWorld = new QDGraphics(new QDRect(32, 32));
>
> SG.setGWorld(TokenGWorld, null);
> System.out.println("Token GWorld set.");
>
> // Create the video channel.
>
> SGVideoChannel VidChan;
>
> VidChan = new SGVideoChannel(SG);
> System.out.println("Video channel created.");
>
> // Create a GWorld whose dimensions match those of the frames the
> // video channel will be providing.
>
> QDGraphics GWorld = new QDGraphics(VidChan.getVideoRect());
>
> SG.setGWorld(GWorld, null);
> System.out.println("Proper GWorld set.");
>
> // Get rid of the token GWorld.
>
> TokenGWorld.disposeQTObject();
>
> // Configure the video channel.
>
> VidChan.setUsage(StdQTConstants.seqGrabRecord);
>
> // settingsDialog() doesn't work; a blank, unusable dialog appears.
> // VidChan.settingsDialog();
>
> VidChan.setFrameRate(30.0f);
>
> 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.");
>
> VidChan.digitizerChanged();
>
> // Record.
>
> SG.prepare(false, true);
> SG.startRecord();
> System.out.println("Recording started. Frame rate: " +
> VidChan.getFrameRate());
>
> SG.idle();
>
> do {
> System.out.print('.');
> } while (SG.idleMore());
>
> System.out.println();
>
> // Cease recording.
>
> 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 session closed.");
> }
> }
> }
>
>
> The code generates the following output:
>
>
> QuickTime session opened.
> Sequence grabber opened.
> Token GWorld set.
> Video channel created.
> Proper GWorld set.
> Max record time set.
> Data reference set.
> Recording started. Frame rate: 30.0
> ..........................................................................
> ..........................................................................
> ................................
>
> java has exited due to signal 10 (SIGBUS).
>
>


mailto:email@hidden
tel: +1 408 974 4056
__________________________________________________________________________
"We'll talk about it later...."
"When?"
"In a future life when we're both cats"
__________________________________________________________________________


References: 
 >Re: Seeking help: video capture failures and crashes (From: "Chris W. Johnson" <email@hidden>)



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.