title: android get screenshot of current videoview
body: <p>I've seen a lot of old questions about this, maybe now there are some solutions. 
  I want to take a screenshot of the current frame of my videoview. Videoview shows a real-time video using a rtsp-stream.</p>
  
  <p>I try to take bitmap, but it's always black</p>
  
  <pre><code>public static Bitmap loadBitmapFromView(View v) {
      Bitmap b = Bitmap.createBitmap(v.getLayoutParams().width , v.getLayoutParams().height, Bitmap.Config.ARGB_8888);                
      Canvas c = new Canvas(b);
      v.layout(0, 0, v.getLayoutParams().width, v.getLayoutParams().height);
      v.draw(c);
      return b;
  }
  </code></pre>
  
  <p><strong>EDIT :</strong>
  <code>MediaMetadataRetriever</code> does not work with stream url, maybe works with video-file.
  Using lib at this <a href="https://github.com/wseemann/FFmpegMediaMetadataRetriever" rel="nofollow">link</a> (it's a wrapper of <code>MediaMetadataRetriever</code> that enable <strong>rtsp</strong> protocol input) I can save a frame of video, but there is a delay of 10 secs respect real-time videoview because it must create a new connection with streaming server.</p>
  
  <p>I not test  <code>ThumbnailUtils</code>, but in Api I read that input is only file-path</p>