sannies / mp4parser

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

MovieCreator.build(videoUri) getTracks empty #320

Open shoyu666 opened 6 years ago

shoyu666 commented 6 years ago

Movie m = MovieCreator.build(videoUri) m.getTracks() is empty

use AppendTrack throw java.util.NoSuchElementException at java.util.LinkedList$ListItr.next(Unknown Source) at org.mp4parser.muxer.builder.DefaultMp4Builder.getTimescale(DefaultMp4Builder.java:628) at org.mp4parser.muxer.builder.DefaultMp4Builder.createMovieBox(DefaultMp4Builder.java:179) at org.mp4parser.muxer.builder.DefaultMp4Builder.build(DefaultMp4Builder.java:110) at com.googlecode.mp4parser.AppendExample.main(AppendExample.java:59)

HBiSoft commented 4 years ago

This happens because you are passing a Uri instead of the file path. I know on Android 10> we can no longer access the file path where we could previously access the path from the _data column using ContentResolver. I hope the author will provide an option to pass a FileInputStream instead of a file path since there is currently no way to pass a file path unless you copy the file to your applications directory.