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

SilencePrepender

public class SilencePrepender extends Object

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


        Movie audioMovie = MovieCreator.build(new FileInputStream("/home/sannies/scm/svn/mp4parser/silence/sample.mp4").getChannel());


        Movie result = new Movie();
        Track audio = audioMovie.getTracks().get(0);

        Track silence = new SilenceTrackImpl(audio, 2000);

        result.addTrack(new AppendTrack(silence, audio));

        IsoFile isoFile = new DefaultMp4Builder().build(result);

        FileChannel fc = new RandomAccessFile(String.format("output.mp4"), "rw").getChannel();
        fc.position(0);
        isoFile.getBox(fc);
        fc.close();