title: Get bitmap / thumbnail from a streaming video with format like .mp4, .3gp in Android?
body: <p>I am working on ListView which on item click redirecting to a video link.
  I explain my problem :</p>
  
  <p>I have three types of videos :</p>
  
  <ul>
  <li>Youtube</li>
  <li>Dailymotion</li>
  <li>Other formats from streaming video like this one : <a href="http://download.wavetlan.com//SVV//Media//HTTP//MP4//ConvertedFiles//MediaCoder//MediaCoder_test3_1m10s_MPEG4SP_VBR_516kbps_320x240_25fps_MPEG1Layer3_CBR_320kbps_Stereo_44100Hz.mp4" rel="nofollow">Video Link</a></li>
  </ul>
  
  <p>I am trying to get thumbnail to get it in my ImageView from my item of my ListView. I encoutered a problem, I get Youtube thumbnail, Dailymotion thumbnail but I couldn't get thumbnail for other formats.</p>
  
  <p>I tried to use MediaMetaDataRetriever class but nothing happens.</p>
  
  <p>Here is the line where I tried to get my bitmap :</p>
  
  <p>We are in my VideoAdapter class in the getView method. <code>holder</code> is my ViewHolder class and <code>thumbVideo</code> is my ImageView.</p>
  
  <p>Here is differents lines I tried :</p>
  
  <p><code>holder.thumbVideo.setImageBitmap(createVideoThumbnail(m_Context, Uri.parse(m_Video.getM_Preview())));</code></p>
  
  <p><code>m_Video</code> is my Video class and the method <code>getM_Preview()</code> is getting the link of video thumbnail.</p>
  
  <p>Here is my <code>createVideoThumbnail(Context context, Uri uri)</code> method : </p>
  
  <pre><code>    public Bitmap createVideoThumbnail(Context context, Uri uri) {
      Bitmap bitmap = null;
      MediaMetadataRetriever retriever = new MediaMetadataRetriever();
      try { 
          retriever.setDataSource(context, uri);
          bitmap = retriever.getFrameAtTime(-1);
      } catch (RuntimeException ex) {
      } finally { 
          try { 
              retriever.release();
          } catch (RuntimeException ex) {
          } 
      } 
      return bitmap;
  }
  </code></pre>
  
  <p>I am looking an answer for 4 days. If anybody know how I can do, it'll be helpful</p>