ADC Home > Reference Library > Technical Q&As > QuickTime > Movie Basics >

Saving QuickTime Movie Files

Here is a series of questions and answers about some complications you might face in creating and saving QuickTime movies:

Q What is the proper way to save existing QuickTime movies after they have been edited?
AMoviePlayer is a good example:
  • "Save" always updates the movie resource in the movie file that you opened and keeps data "alias" references in the movie file. After editing, the file is typically no longer in optimal format for playback.

  • "Save As" gives the user two options:

  1. Creating a new movie file (which maintain data references to the original)

  2. Creating a 'self contained' movie.

In case 1, MoviePlayer calls CreateMovieFile (with the 'createMovieFileDontCreateMovie' flag set) and then calls AddMovieResource using the edited 'original' movie resource.

If the user selects option 2 above, 'create self contained', MoviePlayer calls FlattenMovie and creates a new movie file and resource. (The original file remains open, however.)

Q My application has a Movie resource from the original file which has been modified -- tracks have been added, as well as data (using data references). Should I choose option 1 or 2?

A Either method will work. If you use option 2 (FlattenMovie), the new file is interleaved, which is a good idea since we've got to write all the movie data to disk anyway. FlattenMovie optimizes the file for movie playback. (Be sure to flatten to a new file and don't try to overwrite the original file.)

Q What if I want to keep working with the new movie?
A If you want to work with the new flattened movie, FlattenMovieData is the way to go, since it automatically returns the new movie resource to you. (Use AddMovieResource to write this resource to the new file.)

Q If I use the FlattenMovieData/AddMovieResource method, can I close the original file? I want any further changes to take place in the new movie, not in the original one.

A Yes, you can close the file (and be sure to use DisposeMovie on your original movie resource, which still points back to the original file.)

One more note: going this route does not store the movie in the "fast start" format, so the movie will not be stored optimally for Web or CD playback. (Hard drives typically aren't affected by this.) If you want the file to be in the very best playback format for cross-platform play, use FlattenMovie with the 'flattenAddMovieToDataFork' flag set. You'll then need to open this movie just as you did the original (i.e., with OpenMovieFile/ NewMovieFromFile).

[Jan 31 1997]


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.