are there any library for react native to crop videos. by cropping videos I mean showing some part of the video and rejecting other parts like we crop the images. I am not talking about trimming the video because there is a difference between the word trim and crop
Have you tried https://github.com/shahen94/react-native-video-processing?
Here's an example of how it would be used to crop:
// portrait video output 720 x 1280
const aspectRatio = 640 / 480;
const outputWidth = video.width;
const outputHeight = parseInt(outputWidth * aspectRatio);
const options = {
cropWidth: video.width,
cropHeight: outputHeight,
cropOffsetX: 0,
cropOffsetY: parseInt(Math.abs((video.height - outputHeight) / 2)),
}
ProcessingManager.crop(video.uri, options).then(data => {
console.log('success', data)
// use video compress for 640 x 480
...
}).catch(error => {
console.log('error', error)
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With