mediametadataretriever

MediaMetadataRetrieverJNI(14060): getFrameAtTime: videoFrame is a NULL pointer(Android)

懵懂的女人 提交于 2019-12-01 19:18:27
I am creating thumbnails by videos frame using MediaMetadataRetriever but I am getting this message in Logcat : E/MediaMetadataRetrieverJNI(14060): getFrameAtTime: videoFrame is a NULL pointer Here is my code: MediaMetadataRetriever retriever = new MediaMetadataRetriever(); try { Uri videoURI = Uri.parse("android.resource://"+getPackageName()+"/"+R.raw.video_one); retriever = new MediaMetadataRetriever(); retriever.setDataSource(mContext, videoURI); Bitmap bitmap = retriever.getFrameAtTime(100000,MediaMetadataRetriever.OPTION_CLOSEST_SYNC ); Drawable drawable = new BitmapDrawable(getResources(

MediaMetadataRetrieverJNI(14060): getFrameAtTime: videoFrame is a NULL pointer(Android)

♀尐吖头ヾ 提交于 2019-12-01 18:18:40
问题 I am creating thumbnails by videos frame using MediaMetadataRetriever but I am getting this message in Logcat : E/MediaMetadataRetrieverJNI(14060): getFrameAtTime: videoFrame is a NULL pointer Here is my code: MediaMetadataRetriever retriever = new MediaMetadataRetriever(); try { Uri videoURI = Uri.parse("android.resource://"+getPackageName()+"/"+R.raw.video_one); retriever = new MediaMetadataRetriever(); retriever.setDataSource(mContext, videoURI); Bitmap bitmap = retriever.getFrameAtTime

MediaMetadataRetriever setDataSource throws IllegalArgumentException

大憨熊 提交于 2019-11-27 22:16:29
I'm trying to get the size of a remote video using this class and i'm getting IllegalArgumentException if the video is remote. the video is an mp4 stored in one server... the video plays correctly if i play it with mediaplayer, but it gives the error if i try to do this: try { MediaMetadataRetriever retriever = new MediaMetadataRetriever(); Bitmap bmp = null; retriever.setDataSource(context, uri); bmp = retriever.getFrameAtTime(); videoHeight = (int) (bmp.getHeight()*((float)getIntWidth()/bmp.getWidth())); } catch (Exception e) { e.printStackTrace(); } the error is thrown in this line: