I am streaming a video and playing it from my android app. Now, I want to know the audio and video codec that is used. I have a textbox to get the url the user wants to stream. Now, I run my media player with this url as datasource. Is it possible to find the codec of the video streaming url? If so, which classes should I use. I have gone through MediaCodec and still not sure.
Asked
Active
Viewed 1,393 times
1
-
Maybe a guess for the mime type gives you an indication: [stackoverflow post](http://stackoverflow.com/questions/51438/getting-a-files-mime-type-in-java) - I think you must go for the "2nd answer" with this library [Link](https://subversion.servoy.com/product/trunk/servoy_shared/src/com/servoy/j2db/util/MimeTypes.java) – Markus Apr 01 '14 at 13:57
-
@Markus I want to know the details of the video and audio codec. For example, whether the audio codec used is AAC or AMR. Similarly whether the video is H.264 or MPEG4 etc. – Manikandan Kandasamy Apr 02 '14 at 10:46
-
Does this post help? [Stackoverflow on Xuggle](http://stackoverflow.com/a/13736067/2191131) – Markus Apr 02 '14 at 11:13
-
That really helped. But the jar is 30MB, so i cant use it in android pretty much. I somehow found a way ( atleast i hope so) using [this](http://developer.android.com/reference/android/media/MediaPlayer.TrackInfo.html#getFormat%28%29) That lead me to new weird [error](http://stackoverflow.com/questions/22839982/android-mediaplayer-trackinfo-getformat-is-not-defined). Have a look if you can find time. Thanks for the Xuggle reference – Manikandan Kandasamy Apr 03 '14 at 14:01