I started building the video editing app.Now i am able get the frames from current position and i stored the bitmaps in arraylist. I want display them in a view , which should look like playing a trimmed video clip or kind of animation? Please suggest me in this regard.
3
- 1hmmm.... I think you should have benefits from the use of opengl...Seraphim's– Seraphim's2013-10-07 13:48:04 +00:00Commented Oct 7, 2013 at 13:48
- what are other best approach with native API's?user2854873– user28548732013-10-07 13:49:13 +00:00Commented Oct 7, 2013 at 13:49
- nothing really performing I suppose. How many frames? How many fps?Seraphim's– Seraphim's2013-10-07 13:54:07 +00:00Commented Oct 7, 2013 at 13:54
Add a comment |
1 Answer
You can try this to extract frame:
package com.example.androidmediametadataretriever; import android.graphics.Bitmap; import android.media.MediaMetadataRetriever; import android.os.Bundle; import android.widget.ImageView; import android.app.Activity; public class MainActivity extends Activity { String uri = "/storage/sdcard0/DCIM/100MEDIA/VIDEO0007.mp4"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ImageView capturedImageView = (ImageView)findViewById(R.id.capturedimage); MediaMetadataRetriever mediaMetadataRetriever = new MediaMetadataRetriever(); mediaMetadataRetriever.setDataSource(uri); Bitmap bmFrame = mediaMetadataRetriever.getFrameAtTime(5000000); //unit in microsecond capturedImageView.setImageBitmap(bmFrame); } } 10 Comments
user2854873
i tried the same code,i set fps=30, and i captured the frames around 1 sec , nearly i got 34 bitmaps, which i stored in arraylist, now i wanted to display them one by one,plz let how can i achieve that?
Seraphim's
I think you can start from here: stackoverflow.com/questions/4724355/…
user2854873
Thanks a lot, i look into that post
Seraphim's
a simple approach: smartandroidians.blogspot.it/2010/02/…
user2854873
Thanks for your kind support. I tried with getFrameAt(time,MediaMetadataRetriever_OPTION_CLOSEST) but i am getting null value.
|