deepmedia / Transcoder

🎞 Hardware-accelerated video transcoding using Android MediaCodec APIs. Supports cropping, concatenation, clipping, audio processing, video speed and much more.
https://opensource.deepmedia.io/transcoder
Apache License 2.0
783 stars 166 forks source link

Fix NullPointerException #134

Closed DamonChen117 closed 3 years ago

DamonChen117 commented 3 years ago

https://github.com/natario1/Transcoder/issues/133

Fix NullPointerException with ClipDataSource(FilePathDataSource()) Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.media.MediaMetadataRetriever.extractMetadata(int)' on a null object reference at com.otaliastudios.transcoder.source.DefaultDataSource.getDurationUs(DefaultDataSource.java:276) at com.otaliastudios.transcoder.source.ClipDataSource.getSourceDurationUs(ClipDataSource.java:23) at com.otaliastudios.transcoder.source.ClipDataSource.(ClipDataSource.java:18)

natario1 commented 3 years ago

Thanks a lot!