Ypimagepicker: Problem video compression when selected from library

Created on 10 Jul 2019  路  11Comments  路  Source: Yummypets/YPImagePicker

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

Most helpful comment

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

All 11 comments

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

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

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

@UtkuDalmaz while trying to fix https://github.com/Yummypets/YPImagePicker/issues/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. :)

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

@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 馃檹

@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 :)

@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

@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

@s4cha @NikKovIos any updates on this? :)

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

Was this page helpful?
0 / 5 - 0 ratings