I'm just starting on android development.
I've been trying for some time to extract frames from video files I have on my phone like this:
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
retriever.setDataSource(getApplicationContext(),linkToVideo); // linkToVideo is Uri
ImageView frameView = (ImageView) findViewById(R.id.video_frame);
frameView.setImageBitmap(retriever.getFrameAtTime(frameTime,MediaMetadataRetriever.OPTION_CLOSEST)); // frameTime in microseconds
This works for 640x480 .mp4 videos but not for the 1280x720 .3gp files my camera has recorded. It just takes an awfull long time and eventually the app stops responding. When I use OPTION_CLOSEST_SYNC everything runs smoothly, however I'm interested in getting more than the sync frames.
Any ideas on how I can solve this? I was trying to avoid video encoding but if there is no other option I'll resort to that.
Thanks in advance for the time you take to help me.