sannies / mp4parser

A Java API to read, write and create MP4 files
Apache License 2.0
2.74k stars 563 forks source link

GetDuration class returns NaN #444

Closed jessebarnum closed 2 years ago

jessebarnum commented 2 years ago

When I try to run the GetDuration example code, I get this error:

Exception in thread "main" java.io.FileNotFoundException: /Users/jesse/Downloads/mp4parser-master/examples/$%7bproject.build.directory%7d/classes/count-video.mp4 (No such file or directory)

When I replaced the filename variable with a hard-coded path to count-video.mp4, I get this output: NaN

Is this project supposed to be able to get the duration of a mp4 file? Is there any working example for that?

jessebarnum commented 2 years ago

When I built the project using mvn install, and used the generated jar, then it worked. The problem occurred when I tried to import the pom.xml into my IDE (IntelliJ) and run it from the source code.