title: How to get image from video file
body: <p>Hi i'm developer in korea. I have some question so i enter this site.</p>
  
  <pre><code>    InputStream is;
      URL url = 
           new URL("http://112.216.25.58:8888/VOD_LAUNCHER/media/youtube_sample3.mp4");
      Uri uri = Uri.parse(url.toURI().toString());
      is = getContentResolver().openInputStream(uri);
      Bitmap bitmap = BitmapFactory.decodeStream(is);
      //Bitmap bitmap = BitmapFactory.decodeFile(url.toString());
      //MediaMetadataRetriever ret = new MediaMetadataRetriever();
      //ret.setDataSource(url.toString());
      //Bitmap bitmap = ret.getFrameAtTime(0);
      //mImageView.setImageURI(uri);
  
      //Bitmap bitmap = ThumbnailUtils.createVideoThumbnail(uri.toString(), Thumbnails.MICRO_KIND);
      mImageView.setImageBitmap(bitmap);
  
  private Bitmap getPreview(URI uri) {
          File image = new File(uri);
  
      BitmapFactory.Options bounds = new BitmapFactory.Options();
      bounds.inJustDecodeBounds = true;
      BitmapFactory.decodeFile(image.getPath(), bounds);
      if ((bounds.outWidth == -1) || (bounds.outHeight == -1))
          return null;
  
      int originalSize = (bounds.outHeight &gt; bounds.outWidth) ? bounds.outHeight
              : bounds.outWidth;
  
      BitmapFactory.Options opts = new BitmapFactory.Options();
      //opts.inSampleSize = originalSize / THUMBNAIL_SIZE;
      return BitmapFactory.decodeFile(image.getPath(), opts);     
  }
  
  private String getRealPathFromURI(Uri contentUri) {
      String[] proj = { MediaStore.Images.Media.DATA };
      CursorLoader loader = new CursorLoader(getApplicationContext(), 
                                                contentUri, proj, null, null, null);
      Cursor cursor = loader.loadInBackground();
      int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
      cursor.moveToFirst();
      return cursor.getString(column_index);
  }
  </code></pre>
  
  <p>I try to use ThumbnailUtil and etc but it didn't work.
  How to get ThumbnailImage on android 4.0? 
  Thanks any reply.</p>