sannies / mp4parser

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

NullPointerException when trying on Android corrupt video file #458

Open Toby237 opened 1 year ago

Toby237 commented 1 year ago

I am trying to create a movie object out of a mp4 file that is corrupt (because of an abrupt interruption during a video recording on an Android phone).

However I end up with the exception: java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.List org.mp4parser.boxes.iso14496.part12.MovieBox.getBoxes(java.lang.Class)' on a null object reference

I know that the file exists, and that the file path is correct, the error is thrown when I try to run this line of code: MovieCreator.build("theFile.mp4")

Does this mean that this library cannot be used on this file?

(I can also mention that the line of code above works fine on a non-corrupt mp4 video file)