wseemann / FFmpegMediaMetadataRetriever

FFmpegMediaMetadataRetriever provides a unified interface for retrieving frame and meta data from an input media file.
1.73k stars 387 forks source link

setDataResource() failed. #178

Closed Prateek1105 closed 6 years ago

Prateek1105 commented 6 years ago

I am getting error : java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA on code :

@Override public View getView(int i, View view, ViewGroup viewGroup) {

    view = inflater.inflate(R.layout.customlayout , null);
    tv = (TextView)view.findViewById(R.id.textView2);
    iv = (ImageView)view.findViewById(R.id.imageView);
    tv.setText((String) songs.get(i));

    metaRetriver.setDataSource((String) path.get(i));
    try {
        art = metaRetriver.getEmbeddedPicture();
        Bitmap songImage = BitmapFactory.decodeByteArray(art, 0, art.length);
        iv.setImageBitmap(songImage);
    }

    catch (Exception e) {
        //iv.setBackgroundColor(Color.GRAY);
    }

    return view;
}
zeeshanaslam78 commented 6 years ago

Try this


FFmpegMediaMetadataRetriever mmr = new FFmpegMediaMetadataRetriever();
mmr.setDataSource((String) path.get(i));  

Bitmap bm = mmr.getFrameAtTime(2000000, FFmpegMediaMetadataRetriever.OPTION_CLOSEST);

iv.setImageBitmap(bm);

mmr.release();
redacted-text commented 6 years ago

Please, see https://github.com/wseemann/FFmpegMediaMetadataRetriever/issues/59 That helped me.

wseemann commented 6 years ago

@Prateek1105 The exception is self explanatory. It means the data source you passed is invalid. Perhaps it has contains an unsupported protocol, the path is incorrect, etc.