Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Choosing video files shows processing assets . how to avoid compressing videos ? compressVideo = false not working #950

Open
nikhilbiju67 opened this issue Mar 2, 2019 · 4 comments · May be fixed by #1759

Comments

@nikhilbiju67
Copy link

Version

Tell us which versions you are using:

  • react-native-image-crop-picker v0.?.?
  • react-native v0.?.?

Platform

Tell us to which platform this issue is related

  • iOS
  • Android

Expected behaviour

Actual behaviour

Steps to reproduce

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

@nikhilbiju67 nikhilbiju67 changed the title Choosng video files shows processing assets for ever how to avoid compressing videos ? compressVideo = false not working Choosng video files shows processing assets . how to avoid compressing videos ? compressVideo = false not working Mar 2, 2019
@nikhilbiju67 nikhilbiju67 changed the title Choosng video files shows processing assets . how to avoid compressing videos ? compressVideo = false not working Choosing video files shows processing assets . how to avoid compressing videos ? compressVideo = false not working Mar 4, 2019
@kevmmdev
Copy link

kevmmdev commented Sep 4, 2019

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.

@bogdancochioras-clarisoft
Copy link

@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

@ganzik83 ganzik83 mentioned this issue Apr 5, 2020
Closed
@foufrix
Copy link

foufrix commented Oct 19, 2020

@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.

luoxuhai added a commit to luoxuhai/react-native-image-crop-picker that referenced this issue Mar 26, 2022
luoxuhai added a commit to luoxuhai/react-native-image-crop-picker that referenced this issue Mar 26, 2022
@luoxuhai luoxuhai linked a pull request Mar 26, 2022 that will close this issue
luoxuhai added a commit to luoxuhai/react-native-image-crop-picker that referenced this issue Mar 26, 2022
@bvelasquez
Copy link

There's a PR for this. It would be great to get that PR merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants