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

Preview/Streaming is rotated upside down on Nexus 6P #266

Closed
mmaschenko opened this issue Dec 8, 2018 · 7 comments
Closed

Preview/Streaming is rotated upside down on Nexus 6P #266

mmaschenko opened this issue Dec 8, 2018 · 7 comments

Comments

@mmaschenko
Copy link

I have found that specifically on Nexus 6P camera is rotated upside down for some reason.

@pedroSG94
Copy link
Owner

pedroSG94 commented Dec 8, 2018

  • In portrait or landscape?
  • Front or back camera?
  • Which view are you using? SurfaceView, TextureView, LightOpenGlView or OpenGlView?

@mmaschenko
Copy link
Author

OpenGlView, front and back camera, portrait/landscape, livestream/preview

@pedroSG94
Copy link
Owner

If this is only with nexus 6P you can do it in onCreate method:

if (is6p) {
    openGlView.setCameraFlip(false, true);
}

@paNjii
Copy link

paNjii commented Mar 12, 2019

I would like to add that with the Nexus 5X we experience the same behavior. As far as I have been able to tell, this is in the preview only, using a SurfaceView. This is with version 1.5.1.

@pedroSG94
Copy link
Owner

pedroSG94 commented Mar 12, 2019

Try use openglview with camera1 and camera2 and use setCameraFlip. Other way could be change rotate in prepareVideo method only with nexus 5x and with camera2.

I had a nexus 5x years ago and I know that camera is rotated for some reason(I think this is a hardware problem). Unfortunately I haven't this device anymore so I can't find a valid solution to work with all devices (Maybe it is not possible with surfaceview).
If the problem persist the only way is develop a method to rotate only preview with openglview and lightopenglview.

@paNjii
Copy link

paNjii commented Mar 12, 2019

Thanks for the quick reply. I followed your advice and changed my standard SurfaceView to the OpenGLView. I then check for the model type and apply the vertical flip if necessary. Am I correct in that this is necessary? Or should it work out of the box with the OpenGLView? As a note, I am using RtmpCamera1 for compatibility reasons.

@paNjii
Copy link

paNjii commented Mar 12, 2019

Also, I don't know how much the emulator differs. But I use a 5X image in the emulator and the preview there is fine. So probably hardware issue?

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

3 participants