Juman8 / React-Native-CompressVideo

A native module for trimmer video and compress video fastest
8 stars 1 forks source link

Can you give bit brief description about the video compressing process ? #1

Closed harikrishna1213 closed 4 years ago

harikrishna1213 commented 5 years ago

Hi I have followed the process what you have suggested. I have done all the changes in android studio and added compassvideo and trimmer packages also. I included the required modules in react native code. Please tell me how to compress the video with using "CompareVideo/Compare()" function. How would I pass the video to this function and how we will get the compressed video as result.

Please provide sample code for compressing video process. I want to get compressed video as result

Please help on this ....... Thanks in advance.

Juman8 commented 5 years ago

@harikrishna1213 Sorry for this late reply. First I used a side compression library of android studio: Mp4Composer You can follow it: https://android-arsenal.com/details/1/6720. You must create a new file type mp4 to override the video stream. on onProgress. I sent a event for device as a event: DeviceEventEmitter (you can follow in react-native native module) How would I pass the video to this function : you can passing a path of video url in function Compare as solution import native module (name in function CompareVideo/getName()) after how we will get the compressed video as result: Video after compress success or failed, you can get a result is a promise. ** if path is null ("") ie during compression there are any errors that occur.

You can use Android Studio(logcat) to know the compression process or errors generated during compression I using this solution in my project, It works great so if you have any problems please share it, I will share it enthusiastically