MediaMetadataRetriever setDataSource failed: status = 0xFFFFFFED


I need to fetch frames from video located in the web. That's how I do this:

class PlayerWrapper {
    private static final MediaMetadataRetriever mMediaMetadataRetriever = new MediaMetadataRetriever();


    public void initPlayback(final Context context, final VideoSurfaceView videoSurface, final String url) {
        new Thread(new Runnable() {
            public void run() {

                try {
                    mMediaMetadataRetriever.setDataSource(url, new HashMap<String, String>());
                } catch (Exception e) {


    public Bitmap getFrameAt(int positionMillis) {
        if (mMediaMetadataRetriever != null) {
            DPLog.d("Creating frame for position [%s]", positionMillis);
            try {
                return mMediaMetadataRetriever.getFrameAtTime(positionMillis * 1000);
            } catch (Exception e) {
                return null;
        } else {
            return null;

This works fine on several devices with Android 4.4, 5 and 6. But on one device with Android 4.1.2 setDataSource function fails with following stack trace:

java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFED
       at co.unreel.videoapp.playback.UnreelPlayer$

Also tried this code on emulator, got almost the same but with status 0x80000000

Url is got from YouTube API, looks like this:


<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

Why this can happen and what to do?

I also tried to use FFmpegMediaMetadataRetriever with the same logic, but it doesn't work at all, setDataSource causes exceptions with status 0xFFFFFFFF on all devices. As I found on SO, that means that url is invalid, but it is ok and played by MediaPlayer without any issues. Also I found that ffmpeg has issues with urls longer than 1024, but that's not my case too.

May be there are another way to get frames from video?

asked on Stack Overflow Feb 22, 2016 by darja

2 Answers


Get the same error. setDataSource failed: status = 0xFFFFFFED

Use Crosswalk on android to play a mp3 file on https server. And found this from google source at line 940

Sets the data source (file-path or http/rtsp URL) to use.

maybe setDataSource not support https. and this works when i use http server.

answered on Stack Overflow Mar 11, 2019 by dravensx
private static final String videoPath = 

Uri data = Uri.parse(videoPath);
FFmpegMediaMetadataRetriever fmmr = new FFmpegMediaMetadataRetriever();

I am getting IllegalArgumentException. I am trying to get frames from a video in Android.

answered on Stack Overflow Oct 7, 2019 by robust12 • edited Oct 10, 2019 by solarissmoke

User contributions licensed under CC BY-SA 3.0