I have tried many ways to retrieve the video meta data from url like (http://xxx.xxx.xxx.xxx/streams/xxxx/playlist.m3u8), the project is useing android 2.3.3 SDK.
As I know the MediaMetadataRetriver can solve it with capture_mode but it needs the android vesion level after 14, but android 2.3.3 is level 10. (it doesnt work in project).
MediaMetadataRetriever retr = new MediaMetadataRetriever(); retr.setDataSource(mContext , video.getUriWithDrmCheck());
retr.setMode(MediaMetadataRetriever.MODE_CAPTURE_FRAME_ONLY); Bitmap bm = retr.captureFrame(); int wVideo = bm.getWidth(); int hVideo = bm.getHeight();I have been used vetamio to retrieve the video resolution, but the system crashed. io.vov.vitamio.MediaPlayer m= new io.vov.vitamio.MediaPlayer(this); m.prepareAsyc(); m.setDataSource(url); m.getVideoAspectRatio(); m.release();
The default android.media.mediaplayer in android could not retrieve the url video information. The video height I got from it is 0.
I tried thumbnail method to retrieve the video information, but the Thumbnail method seems can only phase the localPath, not the url link path. Bitmap bMap = ThumbnailUtils.createVideoThumbnail(url, MediaStore.Video.Thumbnails.MICRO_KIND);
So does any one know how to retrieve a stream video (m3u8 format) resolution from url link in android?? thank you very much.