FileDocCategorySizeDatePackage
RemoveSomeSamplesExample.javaAPI Docmp4parser 1.0-RC-171383Wed Dec 19 20:10:38 GMT 2012com.googlecode.mp4parser

RemoveSomeSamplesExample

public class RemoveSomeSamplesExample extends Object
Removes some samples in the middle

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

        String audioEnglish = RemoveSomeSamplesExample.class.getProtectionDomain().getCodeSource().getLocation().getFile() + "/count-english-audio.mp4";
        Movie originalMovie = MovieCreator.build(new FileInputStream(audioEnglish).getChannel());

        Track audio = originalMovie.getTracks().get(0);

        Movie nuMovie = new Movie();
        nuMovie.addTrack(new AppendTrack(new CroppedTrack(audio, 0, 10), new CroppedTrack(audio, 100, audio.getSamples().size())));

        IsoFile out = new DefaultMp4Builder().build(nuMovie);
        FileOutputStream fos = new FileOutputStream(new File("output.mp4"));
        out.getBox(fos.getChannel());
        fos.close();