The Return of the Blue Q
Subject:   Can't you just use the getMovie() Method of Sequence Grabber?
Date:   2004-06-15 14:31:57
From:   CyrusMobasheri
Can't you just use the getMovie() Method of Sequence Grabber, and use this Movie Object in the following line?

Component component = QTFactory.makeQTComponent (movie);

Full Threads Newest First

Showing messages 1 through 2 of 2.

  • Chris Adamson photo Re: Can't you just use the getMovie() Method of Sequence Grabber?
    2004-06-16 05:19:18  Chris Adamson | O'Reilly AuthorO'Reilly Blogger [View]

    Have you tried it? It will compile, but it seems like the native structure wrapped by the Movie dies as soon as you create it.

    Here's the critical section of some test code I wrote:;
    grabber = new SequenceGrabber();
    SGVideoChannel vChannel = new SGVideoChannel(grabber);
    System.out.println ("got video channel, sourceVideoBounds = " +
    vChannel.getSrcVideoBounds() +
    ", videoRect = " + vChannel.getVideoRect());

    /* this doesn't work - QT native object is non-existent
    Movie movie = Movie.fromSequenceGrabber(grabber);
    System.out.println (movie);
    QTComponent qtc = QTFactory.makeQTComponent (movie);
    Component c = qtc.asComponent();

    Run this with a camera attached (I'm using an iSight) and here's the output (line breaks inserted for clarity):

    got video channel,
    sourceVideoBounds = quicktime.qd.QDRect[x=0.0,y=0.0,width=1600.0,height=1200.0],
    videoRect = quicktime.qd.QDRect[x=0.0,y=0.0,width=1600.0,height=1200.0]
    quicktime.QTNullPointerException: The QT native object
    represented by this QTJava object is no longer valid:
    at quicktime.QTObject._ID(
    at quicktime.std.movies.Movie.getBounds(
    at quicktime.std.movies.Movie.toString(
    at java.lang.String.valueOf(
    at SGExperiment1.<init>(
    at SGExperiment1.main(

    So, we have some low-level access to the camera pixel data via the video channel, but trying to use high-level concepts like the Movie bomb out: we can't even println it! And taking out the println doesn't help - you'll just get more QTNullPointerExceptions later on when you try to idle the SG.

    I hope to be back soon with a piece on what you can and can't do with QTJ capture. In the meantime, file a bug on QTJ capture being broken. Apple says volume of bug reports is a key determinant of where they apply development effort.

    • you are right and its even worth
      2004-06-20 07:12:54  CyrusMobasheri [View]

      I tried to use the grabPict() methode of the sequencegrabber, but all i get is an empty Pict file.