Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to distinguish between audio file and video file?

I am using Java to write a media application.

Given a file, how can I know is it a audio file or video file?

By the way, I use vlcj library.

like image 411
Bear Avatar asked Dec 08 '25 03:12

Bear


1 Answers

In Java 7 you will be able to use java.nio.file.probeContentType to do this.

In the meantime, there are a number of other options for doing this kind of thing.

like image 110
Stephen C Avatar answered Dec 10 '25 16:12

Stephen C



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!