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

Video with .truncatingRemainder(dividingBy: 4.0) #175

Open
patthehuman opened this issue May 5, 2019 · 0 comments
Open

Video with .truncatingRemainder(dividingBy: 4.0) #175

patthehuman opened this issue May 5, 2019 · 0 comments
Labels

Comments

@patthehuman
Copy link

We are using NextLevel camera in our project and the videos are very pixellated upon preview.

We are resizing the camera preview frame using a previously suggested block of code found in other reported issues on this project:

let addValue =  self.cameraPreviewLayer.frame.size.width.truncatingRemainder(dividingBy: 4.0)
        let dimensions = CGSize(width: cameraPreviewLayer.bounds.size.width + addValue, height: cameraPreviewLayer.bounds.size.height + addValue)

This seems to work great on smaller phones! However on the iPhone XS Max, we are seeing the top and bottom of the video is cut off. This only happens on the XS Max.

We are resizing our preview frame by setting the bounds to 16x9 by multiplying the width of the screen by 1.77778. This ensures both the preview layer are in the same aspect ratio of all phones, and ensures the export is the same size.

Is there a similar fix going around? It seems the iPhone XS Max requires additional mathematical operations to get the video configuration dimensions accurate.

@piemonte piemonte added the bug label May 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants