Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Painting a movie in Android

I'm trying to make an Stop-motion movie creator over Android. I'd like to decode a movie file (mpg, avi, mp4...) and play only some frames (not all). Painting it periodically over a Canvas.

Is there an easy way of doing this?

like image 254
Addev Avatar asked Nov 28 '25 23:11

Addev


1 Answers

I'd like to decode a movie file (mpg, avi, mp4...) and play only some frames (not all).

Android does not really support this offcially. You may end up using the NDK, using third-party video codec library, like ffmpeg to decode a frame.

EDIT : It turns out that Android supports this after-all

getFrameAtTime()

Call this method after setDataSource(). This method finds a representative frame close to the given time position by considering the given option if possible, and returns it as a bitmap. This is useful for generating a thumbnail for an input data source or just obtain and display a frame at the given time position.

like image 197
Reno Avatar answered Dec 01 '25 12:12

Reno



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!