Gonzalo Solera
Gonzalo Solera

Reputation: 1192

I don´t get any bitmap using FFmpegMediaMetadataRetriever

I´m developing an app to extract the frames of a video, but I can´t use MediaMetadataRetriever because it fails a lot of times. So I found a external library called FFmpegMediaMetadataRetriever wrote by William Seemann to extract the frames. But I don´t get any bitmap using the method FFmpegMediaMetadataRetriever.getFrameAtTime(long time).

This is the code I´m trying:

    FFmpegMediaMetadataRetriever mediaData = new FFmpegMediaMetadataRetriever();
    mediaData.setDataSource("/storage/sdcard0/DCIM/video.mp4");

    frame = (ImageView)findViewById(R.id.frame);
    frame.setImageBitmap(mediaData.getFrameAtTime());

Instead, I can get metadata from the video and I can extract frames using MedaMetadataRetriever, so I think the video is right.

I don´t know why I´m not able to extract the frames. If the library works well for me I will be very pleased. Thanks!!

Upvotes: 1

Views: 1227

Answers (1)

William Seemann
William Seemann

Reputation: 3530

There was a bug in the code that was causing null frames to be returned, I just fixed the issue. Please perform a fresh checkout of the code and try again.

Upvotes: 2

Related Questions