android - Nexus 5X records video rotated upside down using MediaRecorder and camera2 -


i'm facing problem recording video new camera2 api. i'm playing project https://github.com/googlesamples/android-camera2video demonstrates video recording using new camera2 api. recording works rotation of recorded mp4 video different because of different devices.

nexus 9 result video fine nexus 5x not.

i've heard nexus 5x has camera rotated upside down. in case set mediarecorder flags record but...

my question is, how recognize programmatically whether device has or doesn't have camera rotated upside down?

thanks help!

i've found solution...

cameramanager manager = (cameramanager) activity.getsystemservice(context.camera_service); string cameraid = manager.getcameraidlist()[0]; cameracharacteristics characteristics = manager.getcameracharacteristics(cameraid); int sensororientation = characteristics.get(cameracharacteristics.sensor_orientation); 

sensororientation value: default camera orientation used 90 degrees. nexus 5x 270 degrees.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -