Reputation: 2614
I'm finding the way to get duration of a GiF. Is there any function like getDuration() for Gif?
Upvotes: 2
Views: 3200
Reputation: 413
Answer given by @samgak was working perfectly, and it works if input video is from assets (raw) folder.
But if we have input video path from device storage then just pass videoPath to Movie
class like below:
Movie movie = Movie.decodeStream(videoPath);
int duration = movie.duration();
and it works fine (for me it's working very well, just a little problem is that it takes a little longer to calculate duration).
Upvotes: 0