wseemann / FFmpegMediaMetadataRetriever

FFmpegMediaMetadataRetriever provides a unified interface for retrieving frame and meta data from an input media file.
1.72k stars 387 forks source link

Getting a frame near the duration of the video returns null #176

Closed mebibou closed 6 years ago

mebibou commented 6 years ago

When using this code:

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:

HBiSoft commented 6 years ago

Did you find a solution?

mebibou commented 6 years ago

No, i have to remove .5s on the duration to make sure I get something

mebibou commented 6 years ago

@wseemann so that means you don't want to look at the issue?