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
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));