Java: How to read available audio tracks in a video file?
Some video files contain multiple audio tracks. Multiple languages for example. Is there a library w开发者_如何学编程hich gets information about these audio tracks? Names of the audio tracks would be sufficient.
It should support common formats (mkv, avi,...)
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).
I have found a solution to my problem. From Java I call the following command:
ffmpeg -i myvideo.mkv
Then I read the commands output and filter the lines which start with Stream #
.
This works on all my files with multiple audio tracks.
精彩评论