Import ffmpeg in your project, grab the portion or entire video and convert it to gif.
or
Use MediaRetriever to extract range of frames with simple looping through the range and then converting to Drawable or Bitmap so you can save it.
or
Grab the frames while the video is playing from the SurfaceViewHolder or SurfaceView Canvas.