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

GetDuration

public class GetDuration extends Object
Gets the duration of a video.

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

        String filename = GetDuration.class.getProtectionDomain().getCodeSource().getLocation().getFile() + "/count-video.mp4";
        IsoFile isoFile = new IsoFile(filename);
        double lengthInSeconds = (double)
                isoFile.getMovieBox().getMovieHeaderBox().getDuration() /
                isoFile.getMovieBox().getMovieHeaderBox().getTimescale();
        System.err.println(lengthInSeconds);