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

Picking a video messes with video_full_range_flag #806

Open
Samigos opened this issue Oct 29, 2023 · 0 comments
Open

Picking a video messes with video_full_range_flag #806

Samigos opened this issue Oct 29, 2023 · 0 comments

Comments

@Samigos
Copy link

Samigos commented Oct 29, 2023

Whenever I'm picking a video and go ahead and display it to the user, every white pixel on screen gets dimmed. (even system whites, like the volume indicator)

I found this SO question that explains my situation exactly and I tried the solution using ffmpegkit and it works, but not always. stackoverflow

Here's my code;

import SwiftUI
import YPImagePicker
import AVFoundation

struct VideoPickerView: UIViewControllerRepresentable {
    @Binding var videoURL: URL?
    
    // ----------------------
    
    func makeUIViewController(context: Context) -> YPImagePicker {
        var config = YPImagePickerConfiguration()
        
        config.screens = [.library]
        config.library.mediaType = .video
        config.showsVideoTrimmer = false
        config.video.libraryTimeLimit = 300.0
        config.video.minimumTimeLimit = 10
        config.video.compression = AVAssetExportPresetPassthrough
        
        let picker = YPImagePicker(configuration: config)
        
        picker.didFinishPicking { [unowned picker] items, _ in
            if let video = items.singleVideo {
                videoURL = video.url
            }
            
            picker.dismiss(animated: true, completion: nil)
        }
        
        return picker
    }
    
    func updateUIViewController(_ uiViewController: YPImagePicker, context: Context) {}
}

I'm on version 5.2.2 and Xcode 15

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

1 participant