numandev1 / react-native-compressor

🗜️Compress Image, Video, and Audio same like Whatsapp 🚀✨
MIT License
891 stars 85 forks source link

Android Video compression error: setDataSource failed: status = 0x80000000 #307

Open PhilippPriller opened 2 weeks ago

PhilippPriller commented 2 weeks ago

Current behavior

Video.compress() crashes on Android 10 (Samsung Galaxy A7) with error: setDataSource failed: status = 0x80000000. Works on all my other Android Devices, but all of them have Android Version > 10, so maybe thats the issue.

Expected behavior

Should work :)

Platform

React Native Version

0.74.3

React Native Compressor Version

1.8.25

Reproducible Steps And Demo

import { Video as VideoCompressor } from 'react-native-compressor'

function compressVideo(path: string) {
    return VideoCompressor.compress(path, {
      compressionMethod: 'auto'
    })
  }

// path example 'file:///data/user/0/xx.xx.xx/cache/mrousavy-2909129058745738728.mov'

I've been able to trace the issue all the way into the AutoVideoCompression.kt file. There on line 19 setting the data source for some reason fails on that device.

           metaRetriever.setDataSource(srcPath)

I've tried passing the path without the "file:///" part or even passing it as an base64 uri, but on that device nothing seems to work.

github-actions[bot] commented 2 weeks ago

👋 @PhilippPriller Thanks for opening your issue here! If you find this package useful hit the star🌟!