Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nexus 6 Front Camera Upside Down

Tags:

android

I know this question has been asked before, however, I'm unable to find any solutions that work.

The Nexus 6 front camera always displays upside down in my app. Some of the solutions are to use "setDisplayOrientation", which does flip the camera on the screen. However, we encode the video with frames received from onPreviewFrame.

According to the Android SDK Documentation, setDisplayOrientation doesn't actually change the byte[] in onPreviewFrame.

This does not affect the order of byte array passed in onPreviewFrame(byte[], Camera), JPEG pictures, or recorded videos. This method is not allowed to be called during preview.

If it is not possible to get the Nexus 6 front camera onPreviewFrame frames in the correct orientation, what is the fastest way to flip each frame, without suffering a drop in fps.

Thanks!

like image 292
tylerjroach Avatar asked May 29 '15 03:05

tylerjroach


1 Answers

The code snippet under Camera.setDisplayOrientation() resolved this issue for me. You need to try it.

like image 120
Ammar Avatar answered Sep 25 '22 00:09

Ammar