how to change video orientation in MediaRecorder to portrait

前端 未结 5 1357
孤城傲影
孤城傲影 2020-12-13 19:11

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 ?

5条回答
  •  醉梦人生
    2020-12-13 19:15

    I've stuck with this problem before, too. I found that you can use the function setOrientationHint (API 9). Call this function before you call MediaRecorder.prepare(). You can setup the orientation degree for your output video.

    Hope it helps, good luck!

提交回复
热议问题