how to change video orientation in MediaRecorder to portrait

Vladimir Berezkin picture Vladimir Berezkin · Oct 10, 2010 · Viewed 30.3k times · Source

When I record video by MediaRecorder, it always records in landscape mode, regardless of real device orientation. How to force MediaRecorder/Camera use real orientation ?

Answer

artsylar picture artsylar · Aug 22, 2011

refer to Camera.Parameters.setRotation() for more information.

There is an example there and instead of calling setRotation(rotation) try to call mediaRecorder.setOrientationHint(rotation) when recording video.