PatrissolJuns / react-native-audio-video-tools

React-native library that allows performing some advanced operation on audios and videos
https://www.npmjs.com/package/react-native-audio-video-tools
MIT License
28 stars 16 forks source link

Getting issue while video compression. #7

Open krupalikevadiya opened 3 years ago

krupalikevadiya commented 3 years ago

I'm using following code to compress video.

ImagePicker.openPicker({ mediaType: "video" }).then(images => { let uri = images.path const videoTools = new VideoTools(uri); videoTools.compress({ quality: 'low' }).then(details => {

  });
    })

Getting below error in both android and ios : Possible Unhandled Promise Rejection (id: 7): "An error occur while getting input file details. Please check your input file details"

PatrissolJuns commented 3 years ago

The "An error occurred while getting input file details. Please check your input file details" appear when there's an error while getting media details. So can you properly run getDetails and check your logs?

krupalikevadiya commented 3 years ago

My file path is something like that : file:///Users/mac/Library/Developer/CoreSimulator/Devices/E60F33EF-3829-4D60-AAEA-A4AA49E5C9A0/data/Containers/Data/Application/C8B2EA75-F278-4206-9EE9-1DDD2362AC22/tmp/react-native-image-crop-picker/06475019-8BB3-44AC-82CF-3C32CCE0C478.mp4

and i used below code to get details but gives error. let uri = images.path

    console.log('===========uri=============' + JSON.stringify(uri, null, 2))
    const videoTools = new VideoTools(uri);

    videoTools.getDetails().then(details => {
      console.log("===========getDetails============== " + JSON.stringify(details,null,2));
  });

and error is :

Possible Unhandled Promise Rejection (id: 6): Error: Failed to execute command

krupalikevadiya commented 3 years ago

@PatrissolJuns any update on it?