Mailing Lists: Apple Mailing Lists

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

editing mpg1 videos



Hi there,

does anybody have experience with editing mpg1 encoded video files?

I'd like to extract one piece from one mpg1-movie and make it an individual mpg-movie. It worked fine with QT movs before but not with mpg1.

There are two things that are strange:
1. the file size of the destination movie is as big as the source movie
2. the destination mpg-movie is only played correctly by Quicktime Player, Windows Media Player keeps on playing the full length despite having been edited.


Here is the code where it all goes down. Do I have to tweak the StdQTConstants?

// one piece of the source movie is extracted and inserted into the destination copiedMovie
public void doCopy(String srcFile, int start, int duration) throws QTException {
copiedMovie = new Movie();
OpenMovieFile omf = OpenMovieFile.asRead (new QTFile(new File(path + srcFile) ) );
movie = Movie.fromFile (omf);


       movie.insertSegment (copiedMovie,
                            start, //startTime
                            duration, //duration in ms
                            0);  //startTime in other movie
   }


// dest copiedMovie is saved public void doFlatten(String dstFile) throws QTException{ file = new QTFile(new File(path + dstFile) );

     copiedMovie.flatten(StdQTConstants.flattenAddMovieToDataFork |
                         StdQTConstants.flattenForceMovieResourceBeforeMovieData,
                         file,
                         StdQTConstants.kMoviePlayer,
                         IOConstants.smSystemScript,
                         StdQTConstants.createMovieFileDeleteCurFile,
                         StdQTConstants.movieInDataForkResID,
                         null
     );
   }


Many thanks in advance
Thomas


_______________________________________________
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.