Closed unoegohh closed 2 years ago
@unoegohh let me see it
@unoegohh are you want manual compression or auto compression-like WhatsApp?
@unoegohh if I use maxSize: 1000
then I am getting 562x1000
resolution of the video which you have attached
const dstUrl = await Video.compress(
sourceVideo,
{
compressionMethod: 'auto',
minimumFileSizeForCompress: 5,
maxSize: 1000,
},
(progress) => {
if (backgroundMode) {
console.log('Compression Progress: ', progress);
} else {
setCompressingProgress(progress);
}
}
);
Hmm it is strange cause if i use
import {Video as VideoCompressor} from 'react-native-compressor';
VideoCompressor.compress(file.path, {
compressionMethod: 'auto',
minimumFileSizeForCompress: 5,
maxSize: 1000,
})
.then(res => {
console.log('video', res);
})
.catch(console.log);
and then i get
video1 file:///Users/unoegohh/Library/Developer/CoreSimulator/Devices/C856B11B-463E-48F6-9396-5F4E0838CDC2/data/Containers/Data/Application/60489947-00AB-49D1-A5F0-E72164EDD6D5/tmp/react-native-image-crop-picker/F6B9FBB8-4C2A-4882-ABBC-A3E9BFE8A0C7.mp4
and it is still get 320x564 video
UPD - i got my error) i was using ImagePicker.openPicker before compression and it returned already compressed video )) ty! as always i need to find error on my side first then write an issue)
@unoegohh yes react-native-image-crop-picker =>. openPicker
is compressing video by reducing video height and width. can you put your video file into tmp directory and add a path directly to test VideoCompressor.compress("file:///...../tmp/filename.mp4"
I think it is already fixed. feel free to reopen if you see this problem again. thanks.
Hi! I am having troubles with video compression
original file original file is 42mb 1080 × 1920 30 sec compressed always 3.2 mb 360 × 568
i need to do something to make video 600x1000 i have tried all params from doc but nothing changes( mb i am doing something wrong and i tried different video