Open nikhilbiju67 opened 5 years ago
Regarding using 'compressVideoPreset' since the documentation is lacking and only stating the default for ios is 'MediumQuality', by default the IOS video compression is too much and I had to do a lot of guessing for the other values of 'compressVideoPreset' because on the documentation there are no other value samples. The value that worked for me was 'HighestQuality' which leaves the video very high quality, it was a guessing game for me. So I guess for the values for compressVideoPreset are 'LowestQuality, 'MediumQuality', 'HighestQuality'. setting it to null crashes the app same with setting it to false.
There is actually no Video compression at the moment on android.
@electricfeel1979
From the init
method I see the following presets are set:
NSMutableDictionary *dic = [[NSMutableDictionary alloc] initWithDictionary:@{
@"640x480": AVAssetExportPreset640x480,
@"960x540": AVAssetExportPreset960x540,
@"1280x720": AVAssetExportPreset1280x720,
@"1920x1080": AVAssetExportPreset1920x1080,
@"LowQuality": AVAssetExportPresetLowQuality,
@"MediumQuality": AVAssetExportPresetMediumQuality,
@"HighestQuality": AVAssetExportPresetHighestQuality,
@"Passthrough": AVAssetExportPresetPassthrough,
}];
if (@available(iOS 9.0, *)) {
[dic addEntriesFromDictionary:@{@"3840x2160": AVAssetExportPreset3840x2160}];
} else {
// Fallback on earlier versions
}
self.exportPresets = dic;
return self;
}
From what I know Passthrough
is available from iOS 11 and it seems 3840x2160
option from iOS 9. From experience I would sugest you use the HighestQuality
options which would work on any version and possibly in future iOS versions and it also producess a good result. the only option that you have if you really don't want to use any compression would be Passthrough
but, video quality is also specified in the Imagepicker's native properties picker.videoQuality = UIImagePickerControllerQualityTypeHigh;
so I don't think you can achieve what you want since Apple doesn't really support any video compression or just started suporting this or not really if you check the Passthrough
definition from Apple: AVAssetExportPresetPassthrough
@bogdancochioras-clarisoft is is possible to have no compression ? I tried with Passthrough and still on big video file (90 minutes) processing asset is way too long.
There's a PR for this. It would be great to get that PR merged.
Version
Tell us which versions you are using:
Platform
Tell us to which platform this issue is related
Expected behaviour
Actual behaviour
Steps to reproduce
1.
2.
3.
Attachments
// stacktrace or any other useful debug info
Love react-native-image-crop-picker? Please consider supporting our collective: 👉 https://opencollective.com/react-native-image-crop-picker/donate