Saving the first and last frames of a video as an image on Android

I want to save the first and last frames of a video as images.

Is there any way to do this?

+4
source share
2 answers

You can take a look at the MediaMetadataRetriever class.

In particular, the getFrameAtTime(long) method.

To get the time of the last frame, use getDuration() , which will return the duration of the video.

Note. Accessible from API Level 10!

+3
source

You can use the MediaMetadataRetriever class.

And the getFrameAtTime(timeUs) method. timeUs is in microseconds.

+1
source

Source: https://habr.com/ru/post/1386055/


All Articles