I am trying to extract Thumbnail images from a Video file, the use case is that I want a Bitmap image for every other second of the video, I tried using MediaMetadataRetriever, but the problem is it returns same frames, no matter what the time is.
This is the code which I had tried
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
retriever.setDataSource(PATH);
for(int i = 0; i< 10 ;i++) {
Bitmap bmp = retriever.getFrameAtTime(i * 1000, MediaMetadataRetriever.OPTION_CLOSEST);
imgList.add(bmp);
System.out.println(imgList.size());
}
Is there any other feasible solution to get Frames periodically?