jonataslaw / VideoCompress

Compress videos, remove audio, manipulate thumbnails, and make your video compatible with all platforms through this lightweight and efficient library.
MIT License
227 stars 262 forks source link

Getting FATAL EXCEPTION: java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA #198

Open GraSim opened 2 years ago

GraSim commented 2 years ago

I'm trying to convert .avi and .mjpg file to .mp4 with this plugin and I am getting the exception below. Any idea what may be causing this?

D/AndroidRuntime(24715): Shutting down VM
E/AndroidRuntime(24715): FATAL EXCEPTION: main
E/AndroidRuntime(24715): Process: com.xxxx.xxxxx, PID: 24715
E/AndroidRuntime(24715): java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA
E/AndroidRuntime(24715):    at android.media.MediaMetadataRetriever._setDataSource(Native Method)
E/AndroidRuntime(24715):    at android.media.MediaMetadataRetriever.setDataSource(MediaMetadataRetriever.java:313)
E/AndroidRuntime(24715):    at android.media.MediaMetadataRetriever.setDataSource(MediaMetadataRetriever.java:254)
E/AndroidRuntime(24715):    at android.media.MediaMetadataRetriever.setDataSource(MediaMetadataRetriever.java:359)
E/AndroidRuntime(24715):    at com.example.video_compress.Utility.getMediaInfoJson(Utility.kt:38)
E/AndroidRuntime(24715):    at com.example.video_compress.VideoCompressPlugin$onMethodCall$1.onTranscodeCompleted(VideoCompressPlugin.kt:160)
E/AndroidRuntime(24715):    at com.otaliastudios.transcoder.Transcoder$ListenerWrapper$2.run(Transcoder.java:213)
E/AndroidRuntime(24715):    at android.os.Handler.handleCallback(Handler.java:938)
E/AndroidRuntime(24715):    at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(24715):    at android.os.Looper.loopOnce(Looper.java:226)
E/AndroidRuntime(24715):    at android.os.Looper.loop(Looper.java:313)
E/AndroidRuntime(24715):    at android.app.ActivityThread.main(ActivityThread.java:8663)
E/AndroidRuntime(24715):    at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(24715):    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)
E/AndroidRuntime(24715):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
I/Process (24715): Sending signal. PID: 24715 SIG: 9
Lost connection to device.

Devices tested: Samsung s10 - Android 12 Samsung s9 - Android 10

  Future<void> compressVideo(String pathFile) async {
    var _fileExists = await File(pathFile).exists();
    if(_fileExists){
      VideoCompress.compressVideo(
        pathFile,
        //file.absolute.path,
        quality: VideoQuality.HighestQuality,
        deleteOrigin: false, 
      );
    }
}

File path looks like: '/data/user/0/com.xxx.xxxx/app_flutter/h-20220825-125927-00003_03.avi'
or /storage/emulated/0/Android/data/com.xxx.xxxx/files/h-20220825-124714-00003_03.avi

Permissions set in AndroidManifest.xml

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
edgunn commented 2 years ago

I'm getting this too

Looks like no file found here, causing app to crash. I don't think this is a fault of this package

GraSim commented 1 year ago

Which is why I included the file exists check, but still getting the error. @jonataslaw can you comment on this issue with a yes or no? Thanks

mirkancal commented 1 year ago

I'm also compressing videos with this package and then upload, one user can't upload anything, among like 2 TB uploads. I see from Intercom(unfortunately not on Sentry), his device is also Samsung S9 and Android 10.

wantroba commented 11 months ago

I'm getting this too

LuckyJayce commented 8 months ago

I also encountered this problem. When I send multiple videos at the same time, it will crash. If I don't put them in the queue and compress them, there will be no error.

andrezanna commented 3 months ago

Any updates on this? This is happening in my app too