0

I want to get the frames of a video file to show in a gallery view in android. and how to edit frames, for example

Select frame sections

use selected sections

delete selected sections

copy selected sections

cut selected sections

paste into the head

paste into the tail

Ashish Dwivedi
  • 8,048
  • 5
  • 58
  • 78
  • Sounds like a video editor, ICS version of android already has a video editor by default. So you can have a look. – Deepak Apr 09 '12 at 09:42
  • @Deepak , I have to work with android 2.3, so now first goal is how to get the list of thumbnails of frames of video file to show in gallery view – Ashish Dwivedi Apr 09 '12 at 09:56
  • Check out [this](http://stackoverflow.com/questions/22684347/extract-all-video-frames-in-android/43026616#43026616) regarding how to extract image frames from video file using ffmpeg – Android Developer Mar 26 '17 at 08:41

2 Answers2

2

You can use the MediaMetadataRetriever class. It has getFrameAt() method wherein you can specify the time of the frame that you want to get.

For details refer to MediaMetadataRetriever

artsylar
  • 2,648
  • 4
  • 34
  • 51
  • 2
    [MediaMetadataRetriever's getFrameAtTime](http://developer.android.com/reference/android/media/MediaMetadataRetriever.html#getFrameAtTime%28long,%20int%29) method always return same frame – Ashish Dwivedi Apr 17 '12 at 09:36
2

Actually, MediaMetadataRetriever.getFrameAtTime uses microseconds as a parameter, not milliseconds. Once you make that change, you can get the correct frames from the video.

Rickster
  • 870
  • 10
  • 17
  • It looks like this returns a frame for each second. If you ask for a frame at 1s = 1000000us or at 1.9s = 1900000us you get the same frame. – kingston Mar 02 '23 at 11:25