Android Rotate Surface created using MediaCodec
问题 I am using Camera2 APIs to capture video from the Camera. I understand that we need to rotate the preview as Camera2 does not have an equivalent of setDisplayOrientation(). Able to rotate preview using a Matrix. I am also using the MediaCodec APIs to encode the video. The encoded video however is inverted when I rotate the phone 180 degrees. I am out of ideas on how to rotate the encoded video. I tried KEY_ROTATION in MediaFormat while configuring. But I guess this is only while decoding