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

Problem video compression when selected from library #367

Closed
UtkuDalmaz opened this issue Jul 10, 2019 · 11 comments
Closed

Problem video compression when selected from library #367

UtkuDalmaz opened this issue Jul 10, 2019 · 11 comments

Comments

@UtkuDalmaz
Copy link

You can check screen recording here

https://www.icloud.com/photos/#0oBSiCVj9uj0xlsCO3_FLyAbw

here is the configuration

var config = YPImagePickerConfiguration()
        config.library.mediaType = .photoAndVideo
        config.library.onlySquare  = false
        config.onlySquareImagesFromCamera = true
        config.targetImageSize = .original
        config.usesFrontCamera = true
        config.showsPhotoFilters = true
        config.shouldSaveNewPicturesToAlbum = false
        config.albumName = "MyGreatAppName"
        config.screens = [.library, .photo, .video]
        config.startOnScreen = .library
        config.video.recordingTimeLimit = 15
        config.video.libraryTimeLimit = 15
        config.showsCrop = .none
        config.wordings.libraryTitle = "Gallery"
        config.hidesStatusBar = false
        config.library.maxNumberOfItems = 1
        config.library.minNumberOfItems = 1
        config.library.numberOfItemsInRow = 3
        config.library.spacingBetweenItems = 2
        config.isScrollToChangeModesEnabled = false
        config.video.compression = AVAssetExportPresetLowQuality
        config.video.fileType = .mp4
        config.video.minimumTimeLimit = 3.0
        config.video.trimmerMaxDuration = 15.0
        config.video.trimmerMinDuration = 3.0
@UtkuDalmaz
Copy link
Author

I guess this issue is related to iCloud videos.
When a video is stored on iCloud this problem may happen.

@bilgeeren
Copy link

bilgeeren commented Jul 23, 2019

We have the same issue. Also when trying to pick i cloud images program stuck on loading spinner. Is there any chance that you've already solved these? @s4cha @NikKovIos

@kasnitski
Copy link

The same issue for me with iCloud videos. Do you know how to fix this?

@s4cha
Copy link
Member

s4cha commented Jan 7, 2020

@UtkuDalmaz while trying to fix #410 I think I stumbled across the fix for this.
Setting videosOptions.deliveryMode = .highQualityFormat line 71 of LibraryMediaManager.swift fixes it on my side.
The reason is that other delivery modes grab degraded versions of the video (from iCloud for example) and the resulting final video quality is degraded.
It actually makes sense to go get the full resolution video before cropping as to not loose any quality.
Could you try the fix and let me know if this fixes works for you ?
PS: Be sure to test on an actual device as simulator tests proved unreliable in my case.

Concerning the loading time of videos the next focus will be to improve "snappiness" and UX to show loading (which can be long) instead of a seemingly endless spinner. :)

@UtkuDalmaz
Copy link
Author

@s4cha yeah it is working good now. Thank you.
Btw man I posted a question on #373
Could you check it sometime when you are available?

@s4cha
Copy link
Member

s4cha commented Jan 9, 2020

@UtkuDalmaz thanks a ton for letting me know :) The new version is coming out today !
Btw I answered your question, please excuse the oh so late reply 🙏

@s4cha
Copy link
Member

s4cha commented Jan 9, 2020

@bilgeeren @UtkuDalmaz @kasnitski The latest https://github.com/Yummypets/YPImagePicker/releases/tag/4.2.0 version should solve your issues. let me know how this goes :)

@UtkuDalmaz
Copy link
Author

UtkuDalmaz commented Mar 6, 2020

@s4cha sorry for the very late reply but this time I have a problem when a video recorded via YPImagePicker, check this video please https://drive.google.com/open?id=1p7dBU6w-i_VE8adQPscO0tinV0Sh5yqW

There is a strange black space under the video and it is not in expected sizes

@nastasiupta
Copy link

@bilgeeren @UtkuDalmaz @kasnitski The latest https://github.com/Yummypets/YPImagePicker/releases/tag/4.2.0 version should solve your issues. let me know how this goes :)

I still have this issue... you can get the video from here: https://drive.google.com/file/d/1bHEs-iUAS-qPYFiqOeHKFm0aZyBxJEso/view?usp=sharing

@nastasiupta
Copy link

@s4cha @NikKovIos any updates on this? :)

@NikKovIos
Copy link
Collaborator

The original thread is fixed by s4cha. if you need, please, create new issues with good description :)

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

No branches or pull requests

6 participants