Android 从视频中提取音频
我正在使用这个库 https://gist.github.com/ArsalRaza/132a6e99d59aa80b9861ae368bc786d0从我的视频中提取音频。我看到很多使用它的建议。但由于某种原因,我在以下内容中遇到了空指针异常。
// Set up the orientation and starting time for extractor.
MediaMetadataRetriever retrieverSrc = new MediaMetadataRetriever();
retrieverSrc.setDataSource(srcPath);
但是当我调试 retrieverSrc 时,它不为空(这很明显,因为我已经在创建一个新实例)。
srcPath 是 https://video.twimg.com/ext_tw_video/1499813059644305416/pu/vid/902x720/-b3JbGZm825Q6PwT.mp4
出了什么问题?
I am using this libraey https://gist.github.com/ArsalRaza/132a6e99d59aa80b9861ae368bc786d0 to extract audio from my video. I saw a lot of recommendations to use it. But for some reason I am getting a null pointer exception on the following.
// Set up the orientation and starting time for extractor.
MediaMetadataRetriever retrieverSrc = new MediaMetadataRetriever();
retrieverSrc.setDataSource(srcPath);
But when I debug retrieverSrc is not being null (this is obvious because I am already creating a new instance).
srcPath is https://video.twimg.com/ext_tw_video/1499813059644305416/pu/vid/902x720/-b3JbGZm825Q6PwT.mp4
What is going wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,所以我没有使用我正在使用的内容,而是使用了这个
注意我如何在第二个参数中添加 HashMap
Ok so instead of what I was using I used this
notice how I added a HashMap in the second parameter