Mailing Lists: Apple Mailing Lists

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

Save as self-contained movie



hello QT4J folks,

I've run into a discrepancy I hope we can clear up. I've taken some of the code from Chris Adamson's excellent book and created a program which takes two existing Quicktime movie files and places them one after the other in a new Movie object via track manipulation. the Movie object in question is created like so:

        QTFile movFile = new QTFile (new java.io.File("built.mov"));
        Movie builtMovie = Movie.createMovieFile(
                movFile,
                StdQTConstants.kMoviePlayer,
                StdQTConstants.createMovieFileDeleteCurFile |
                        StdQTConstants.createMovieFileDontCreateResFile
        );

once I add the tracks in to the builtMovie object, I insert an HREFTrack that placed at the beginning and has a duration of the first movie. I then want to flatten the builtMovie object into a self- contained Quicktime file with no dependencies, which would look something like:

T0                   T1                                T2
+--------------------+----------------------------------+
| Quicktime movie #1 | Quicktime movie #2               |
| HREFTrack          |                                  |
+--------------------+----------------------------------+

to give you an even clearer picture, here's a screenshot of the Movie Properties as reported by Quicktime Player:

http://www.project55.net/movieprops.png

the problem is that I've found a discrepancy between the movie file that's created by calling builtMovie.flatten() and by calling builtMovie.convertToFile() with StdQTConstants.showUserSettingsDialog as a flag, and selecing "Movie, Self-contained". the difference is the HREFTrack - it works as expected when I call convertToFile() - I can open it in a browser, click on the movie while it's playing, and have the URL open.

if I play the movie file that's produced by flatten() in a browser, it plays, but is not clickable. nothing happens.

	so, here is the code for where I call flatten():

builtMovie.flatten(
StdQTConstants.flattenAddMovieToDataFork |
StdQTConstants.flattenForceMovieResourceBeforeMovieData,
movFile, // fileOut
StdQTConstants.kMoviePlayer, // creator
IOConstants.smSystemScript, // scriptTag
StdQTConstants.createMovieFileDeleteCurFile,
StdQTConstants.movieInDataForkResID,
null
);


it's pretty much straight out of the book. I've tried swapping StdQTConstants a couple of times, to no avail.

	here is the code for where I call convertToFile():

int flags = StdQTConstants.createMovieFileDeleteCurFile |
                StdQTConstants.createMovieFileDontCreateResFile |
                StdQTConstants.showUserSettingsDialog;

builtMovie.convertToFile(
        movFile, // file
        StdQTConstants.kQTFileTypeMovie, // filetype,
        StdQTConstants.kMoviePlayer, // creator
        IOConstants.smSystemScript, // scriptTag
        flags
);

	again, straight out the book.

I've also tried calling flattenData(), which doesn't work much better than flatten. but here it is, anyway:

builtMovie.flattenData(
StdQTConstants.flattenAddMovieToDataFork |
StdQTConstants.flattenForceMovieResourceBeforeMovieData,
movFile, // fileOut
StdQTConstants.kMoviePlayer, // creator
IOConstants.smSystemScript, // scriptTag
StdQTConstants.createMovieFileDeleteCurFile
);


I've also tried using MovieExporter to save the movie that way, which actually blows away the HREFTrack, so that doesn't work for me, either.

in the light of further investigation, I examined the sizes of the files - one produced by convertToFile() with the user settings dialog, and one with flatten(), and they are indeed different:

-rw-r--r--   1 jklett  jklett  20364941 Aug 23 17:48 convertToFile.mov
-rw-r--r--   1 jklett  jklett  20379333 Aug 23 17:46 built-flatten.mov

so what I'm really looking for is how to precisely mimic what's being set by the user settings dialog when one picks "Movie, Self- contained".

	I can provide more code if necessary. thanks to all that read this far!

cheers,

- Jared

--
"Terminak #3 has bad keyboard. Pkease fix."


_______________________________________________ Do not post admin requests to the list. They will be ignored. QuickTime-java mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/quicktime-java/email@hidden

This email sent to 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.