Women in Technology

Hear us Roar



Article:
  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:


    QTSession.open();
    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:
    quicktime.std.movies.Movie
    at quicktime.QTObject._ID(QTObject.java:77)
    at quicktime.std.movies.Movie.getBounds(Movie.java:845)
    at quicktime.std.movies.Movie.toString(Movie.java:2252)
    at java.lang.String.valueOf(String.java:2131)
    at java.io.PrintStream.print(PrintStream.java:462)
    at java.io.PrintStream.println(PrintStream.java:599)
    at SGExperiment1.<init>(SGExperiment1.java:33)
    at SGExperiment1.main(SGExperiment1.java:18)


    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.

    --Chris
    • 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.