I am trying to extract frames from a video file in android. I have searched alot but couldn't find any clue about that. Is there any way we could do this? Could anyone please help me regarding this.
Asked
Active
Viewed 6,806 times
2 Answers
1
Although I'm late but,.
Use a library called - FFmpegMediaMetadataRetriever
Add this line in your build.graddle under module app:
compile 'com.github.wseemann:FFmpegMediaMetadataRetriever:1.0.14'
Rebuild your project.
Use the FFmpegMediaMetadataRetriever class to extract frames,. follow the steps:
FFmpegMediaMetadataRetriever med = new FFmpegMediaMetadataRetriever();
med.setDataSource("your data source");
and in your loop you can grab frame using:
Bitmap bmp = med.getFrameAtTime(i*1000000,FFmpegMediaMetadataRetriever.OPTION_CLOSEST);

Maniraj
- 155
- 9
0
Try to use
Bitmap bitmap = ThumbnailUtils.createVideoThumbnail(videoFile, 0);
and also please visit two sites How to show image and video as thumbnail in grid view?
http://www.codeproject.com/KB/graphics/ExtractVideoFrames.aspx
-
hi balban... thanx alot for your reply... i see that the second link(java code) doesn't seem to be compatible for android. What all i need to do is get the RGB values of each frame from a video file. So for that i am trying to extract all the frames in the video. – srikanth Jul 29 '11 at 06:50
-
thats Gr8... if you find answer useful please mark as correct. That Other can take advantage of this. Thanks – Balban Jul 29 '11 at 06:53