是否存在返回媒体文件比特率、帧率等的 android api?
我正在尝试构建一个 Android 应用程序,它生成媒体文件统计信息,例如音频和音频的比特率。视频的比特率、帧率、编解码器信息等。
我已经能够根据移动设备上外部存储上的可用文件创建播放列表,并使用 MediaPlayer api 播放它们。
但到目前为止我还没有找到任何 api 可以让你从媒体文件中提取上述信息。
我检查了 AudioTrack 类,但它没有达到目的。
如果有人能分享一些对此的见解,那就太好了。
I'm trying to build an android app which generates media file statistics e.g. bitrate for audio & bitrate, frame rate, codec information etc for video.
I have been able to create playlist based on the files available on external storage on mobile device and play them using MediaPlayer apis.
But I haven't found any api so far which lets you extract the above mentioned information from the media files.
I checked AudioTrack class but it doesn't serves the purpose.
It will be absolutely great if some one can share some insights on this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
目前还没有用于此目的的 API。
您可能可以找到一个具有媒体元数据查询功能的开源包(我想 ffmpeg 可以做到这一点)。这些开源库通常用 C 编写,但有可能移植到 NDK(本机开发套件)。另一件需要记住的事情是,比特率、帧率和其他编码参数通常是特定于编解码器的,并且某些编解码器有许可费用。
There isn't currently an API for this.
You can probably find an open source package that has media metadata query functionality (I'd imagine ffmpeg can do this). These open source libraries are usually written in C, but can potentially be ported to the NDK (Native Development Kit). Another thing to remember is that bitrate, framerate, and other encoding parameters are generally codec-specific, and some codecs have licensing fees.