FFmpegMediaMetadataRetriever mmr = new FFmpegMediaMetadataRetriever();
mmr.setDataSource(videoFile);
Long duration = Long.parseLong(mmr.extractMetadata(FFmpegMediaMetadataRetriever.METADATA_KEY_DURATION));
Bitmap bitmap = mmr.getFrameAtTime(duration, FFmpegMediaMetadataRetriever.OPTION_CLOSEST);
I get a null bitmap. I've tried to remove a bit of buffer on the duration, and on my 5 seconds video I can only get a frame up to 4.5 seconds.
2 questions:
is there a particular reason?
would it be possible to just return the closest possible frame instead of returning null?
When using this code:
I get a
null
bitmap. I've tried to remove a bit of buffer on the duration, and on my 5 seconds video I can only get a frame up to 4.5 seconds. 2 questions: