title: Android Video thumbnail from URL
body: <p>I'm trying to get thumbnail from instagram video by using the following method but it loads very slow. Is there another way I can get thumbnail from video url in efficient manner - </p>
  
  <pre><code>public Bitmap retriveVideoFrameFromVideo(String videoPath)
                  throws Throwable
          {
              Bitmap bitmap = null;
              MediaMetadataRetriever mediaMetadataRetriever = null;
              try
              {
                  mediaMetadataRetriever = new MediaMetadataRetriever();
                  if (Build.VERSION.SDK_INT &gt;= 14)
                      mediaMetadataRetriever.setDataSource(videoPath, new HashMap&lt;String, String&gt;());
                  else
                      mediaMetadataRetriever.setDataSource(videoPath);
                  //   mediaMetadataRetriever.setDataSource(videoPath);
                  bitmap = mediaMetadataRetriever.getFrameAtTime();
              }
              catch (Exception e)
              {
                  e.printStackTrace();
                  throw new Throwable(
                          "Exception in retriveVideoFrameFromVideo(String videoPath)"
                                  + e.getMessage());
  
              }
              finally
              {
                  if (mediaMetadataRetriever != null)
                  {
                      mediaMetadataRetriever.release();
                  }
              }
              return bitmap;
          }
  </code></pre>