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

java.lang.Throwable: Exception in retriveVideoFrameFromVideo(String videoPath)setDataSource failed: status = 0xFFFFFFFF #161

Closed eyadshagalih closed 2 years ago

eyadshagalih commented 7 years ago

please any one help me

this is my code if (FileListresults.get(m).localfilestatuse == "Need Dawonload"){uploadstatuse=2; FileNameStringForUpload = "http://g********/uploads/" + TaskIdInt + "/" + FileListresults.get(m).localfilenaem; ;} try { bitmap=null; bitmap =retriveVideoFrameFromVideo(FileNameStringForUpload); } catch (Throwable throwable) { throwable.printStackTrace(); }

public static Bitmap retriveVideoFrameFromVideo(String videoPath)
        throws Throwable
{
    Bitmap bitmapfromret = null;
    FFmpegMediaMetadataRetriever ffmpegMediaMetadataRetriever = new FFmpegMediaMetadataRetriever();
    try
    {
        if (Build.VERSION.SDK_INT >= 14)
            ffmpegMediaMetadataRetriever.setDataSource(videoPath, new HashMap<String, String>());
        else
            ffmpegMediaMetadataRetriever.setDataSource(videoPath);
        bitmapfromret = ffmpegMediaMetadataRetriever.getFrameAtTime();
      //  thumpduration = ffmpegMediaMetadataRetriever
        //        .extractMetadata(FFmpegMediaMetadataRetriever.METADATA_KEY_FILESIZE);

    }
    catch (Exception e)
    {
        e.printStackTrace();
        throw new Throwable(
                "Exception in retriveVideoFrameFromVideo(String videoPath)"
                        + e.getMessage());

    }
    finally
    {
        if (ffmpegMediaMetadataRetriever != null)
        {
            ffmpegMediaMetadataRetriever.release();
        }
    }
    return bitmapfromret;
}

        the error is coming

java.lang.Throwable: Exception in retriveVideoFrameFromVideo(String videoPath)setDataSource failed: status = 0xFFFFFFFF

wseemann commented 2 years ago

This exception indicates the file you specified is invalid or can't be read. Without more information the cause of this error is difficult to debug.