shahen94 / react-native-video-processing

Native Video editing/trimming/compressing :movie_camera: library for React-Native
https://shahen94.github.io/react-native-video-processing/
MIT License
1.24k stars 323 forks source link

[ANDROID] - ProcessingManager.getVideoInfo throw 'setDataSource failed' #311

Open LcsGrz opened 3 years ago

LcsGrz commented 3 years ago

Current Behavior

When you try to get information from the video with the following line of code, the error occurs

const output = await ProcessingManager.getVideoInfo('/storage/emulated/0/DCIM/Camera/VID_20200918_141428.mp4'); ANDROID 10
imagen

Expected Behavior

The expected result is that you return the video information to me This is only happening in android 10 of my phone, from the computer emulator I have no problems but it has android 9. For IOs works fine.

Your Environment

software version
react-native-video-processing From master
react-native 0.63.2
node 12.18.3
walvekarnikhil commented 3 years ago

This is due to Scoped Storage in Android 10.

https://developer.android.com/about/versions/11/privacy/storage#scoped-storage

There is a temporary solution

<manifest ... >
  <!-- This attribute is "false" by default on apps targeting
       Android 10 or higher. -->
  <application 
       android:requestLegacyExternalStorage="true" ........ >
    ......
  </application>
</manifest>
viprocket1 commented 3 years ago

@walvekarnikhil nice to see you again. you solved my problem again. god man. thank you. :)