Java:如何读取视频文件中的可用音轨?
某些视频文件包含多个音轨。例如多种语言。是否有一个库可以获取有关这些音轨的信息?音轨的名称就足够了。
它应该支持常见格式(mkv、avi...)
Some video files contain multiple audio tracks. Multiple languages for example. Is there a library which gets information about these audio tracks? Names of the audio tracks would be sufficient.
It should support common formats (mkv, avi,...)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我相信最好的单一媒体文件库是 VLC 播放器。我似乎记得有一个 Java 包装器,但它可能没有维护(就像所有几周前使用的 Java 包装器一样,呵呵)。
I believe the best monolithic media file library available is that for VLC player. I seem to remember there was a Java wrapper, but it's probably not maintained (like all Java wrappers more than a few weeks old heheh).
我已经找到了解决我的问题的方法。我从 Java 调用以下命令:
然后读取命令输出并过滤以
Stream #
开头的行。这适用于我所有具有多个音轨的文件。
I have found a solution to my problem. From Java I call the following command:
Then I read the commands output and filter the lines which start with
Stream #
.This works on all my files with multiple audio tracks.