itinance / react-native-fs

Native filesystem access for react-native
MIT License
4.94k stars 976 forks source link

Size limit with copyAssetsVideoIOS #960

Open foufrix opened 3 years ago

foufrix commented 3 years ago

Hi everyone, I'm using this functions copyAssetsVideoIOS to import file from ios using ph Adress. Overall it's working well as it's also managing icloud Video, thanks for that ! But i notice a problem on really big file, it directly send back the Promise with the url, and is not waiting for the copy past to be done. I tried with a 1gb file it's working ok, but with a 7gb file it's not. It work on simulator though but not on real device. I there a file limite to this function, that may has to do with the RAM of the device ?

The code i use :

const url = await RNFS.copyAssetsVideoIOS(
    `assets-library://asset/asset.${'mov'}?id=${appleVideoID}&ext=${'mov'}`,
    savePath,
  );
console.log(url)

For the 1gb file it take a bit of time (not long though) to log the path and the import work correctly, but for the 7gb file it directly log the path, but when i try to read the video i have an error that say file is invalid.

image

The error on the console here is because i'm trying to generate thumbnails from the videos but the file is corrupted.

Anyone would have an idea why i encounter this issue, and how to solve it ?

EDIT: logs from ios : image

look like the main thread is overloaded from research on internet. Is there a way to do it using multiple thread in a simple manner ?

pumposh commented 3 years ago

962