Skip to content

Instantly share code, notes, and snippets.

@jthmiranda
Created January 2, 2017 21:20
Show Gist options
  • Save jthmiranda/bad65c67416d842b566878129d9183f5 to your computer and use it in GitHub Desktop.
Save jthmiranda/bad65c67416d842b566878129d9183f5 to your computer and use it in GitHub Desktop.
Get the time lenght from video files using the next repo https://github.com/caprica/vlcj-info
import uk.co.caprica.vlcjinfo.MediaInfo;
import uk.co.caprica.vlcjinfo.Section;
import uk.co.caprica.vlcjinfo.Sections;
public class Ejemplo {
public static void main(String[] args) {
System.setProperty("jna.library.path", "C:\\Program Files\\MediaInfo"); //windows path
MediaInfo media = MediaInfo.mediaInfo("C:\\Videos\\yourVideo.mp4");
Sections sections = media.sections("Video");
Section section = sections.first();
System.out.println(section.value("Duration"));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment