Hi,

I'm trying to sample frames from a video.
However, MediaMetadataRetriever.getFrameAtTime always returns the same frame (the first).

I tried with some emulators (2.3.3 to 4.0.3) and some video formats (including mp4 and 3gp which should be supported according to documentation).

Here is a test code (saveBitmapToFile works well in many other locations so I truest it).

    MediaMetadataRetriever retriever = new MediaMetadataRetriever();
    retriever.setDataSource(filePath);
String value = retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION);
    long length = Long.parseLong(value);

    for(int i = 0; i < length; i += 200)
    {
        Bitmap bitmap = retriever.getFrameAtTime(i);
        saveBitmapToFile(bitmap, debugPath + i + ".jpg");
    }


What am I doing wrong?

By the way, it looks that I'm not the first one bumped into this problem
http://stackoverflow.com/questions/10188938/how-to-get-the-frame-from-video-file-in-android

Thanks in advance
/Yaron


--
Yaron Reinharts
Smart Drive Applications
http://www.poncho.co.il/gateaway.php
https://market.android.com/details?id=com.poncho.gsm.gate.activities



--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to