Exception when calling setDataSource(FileDescriptor) method (failed.: status=0x80000000)

前端 未结 10 1103
野性不改
野性不改 2020-12-09 01:57

I\'m developing a video streaming application and I\'m getting stuck when calling set setDataSource with a FileDescriptor. I want my application to play the video as it is b

10条回答
  •  旧时难觅i
    2020-12-09 02:28

    having the same error, and having read the answer above on file format, I abandonded trying to setDataSource with my .mov file and instead created a video with my Android Telefon Camera which gave me an .mp4 file. I put this in the directory Pictures/. This worked - I cound setDataSource without errors. I hope this is useful to someone.

    File mediaStorageDir = new         File(Environment.getExternalStoragePublicDirectory(
                    Environment.DIRECTORY_PICTURES),     "MyDirectoryUnderPictures");
    File mediaFile_mp4_android;
    mediaFile_mp4_android = new File(mediaStorageDir.getPath()
                        + File.separator
                        + "mp4_test"
                        + ".mp4"); //video taken with android camera
    String filePath_mp4_android = String.valueOf(mediaFile_mp4_android);
    File file_mp4_android = new File(filePath_mp4_android);
    Uri contentUri = Uri.fromFile(file_mp4_android);
    MediaMetadataRetriever mmr = new MediaMetadataRetriever();
    mmr.setDataSource(String.valueOf(contentUri));
    

提交回复
热议问题