Witek
Witek

Reputation: 6472

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 which gets information about these audio tracks? Names of the audio tracks would be sufficient.

It should support common formats (mkv, avi,...)

Upvotes: 2

Views: 937

Answers (2)

Witek
Witek

Reputation: 6472

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.

Upvotes: 0

user595447
user595447

Reputation:

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).

Upvotes: 1

Related Questions