0

I am working on a project to read a video file from sdcard then process frames and re diplay as a video in real time. So far I didn't manage to come up with a solution for directly extract frames from the MediaPlayer like MediaPlayer.getCurrentFrame();. MediaMetadataRetriever.getFrameAtTime() is super slow, difficult to get a descent frame rate.

The only thing I have right now is using a TextureView surface with MediaPlayer. Here I start the MediaPlayer and in real time read the bitmap form TextureView asTextureView.getBitMap(), then process BitMap and display it on another ImageView. Here this gives me a a descent frame rate.

The problem here is TextureView has to be in the xml layout and should visible, Which I do not want.

Can some one please shed some light here? Is it possible to somehow hide the TextureView which is attaching to the MediaPlayer, without fake hiding like using RelativeLayouts :). iOS has a solution for this which is AVPLAyerItemVideoOutput, I need something like that with android.

Or any other work around to extract frames from video file?

Thank you

cdesh
  • 113
  • 8

1 Answers1

1

For video processing ...... you can use the FFMPEG Library for getting frames of videos but for that you have the knowledge of android native integration.

I hope this will help you.enter link description here

Community
  • 1
  • 1
Sohail Zahid
  • 8,099
  • 2
  • 25
  • 41
  • Thanks for the direction. I will try the FFMPEG. But it would be really nice if sdk could support this. Because IOS has this feature. Before submitting a feature request does any one has an idea on how to solve this. Extract frames from a video file(mp4) seamlessly in android mediaplayer? – cdesh Oct 17 '15 at 06:39