FileDocCategorySizeDatePackage
InTestMovieCreator.javaAPI Docmp4parser 1.0-RC-17788Wed Dec 19 20:10:21 GMT 2012com.googlecode.mp4parser.authoring

InTestMovieCreator.java

package com.googlecode.mp4parser.authoring;

import com.googlecode.mp4parser.authoring.builder.SyncSampleIntersectFinderImpl;
import com.googlecode.mp4parser.authoring.container.mp4.MovieCreator;

import java.io.IOException;
import java.nio.channels.Channels;


public class InTestMovieCreator {
    public static Movie createMovieOnlyVideo(String... names) throws IOException {
        Movie m = new Movie();
        for (String name : names) {
            Movie m1 = MovieCreator.build(Channels.newChannel(SyncSampleIntersectFinderImpl.class.getResourceAsStream(name)));
            for (Track track : m1.getTracks()) {
                if ("vide".equals(track.getHandler())) {
                    m.addTrack(track);
                }
            }

        }
        return m;
    }

}