We use the Camera2 API to simultaneously view and encode videos using mediacodec. We know when we need to rotate the camera by requesting "CameraCharacteristics.SENSOR_ORIENTATION", but there is only the option to rotate the preview.
We need to rotate the surface that goes into the encoder so that we do not get the video upside down. (Or rotate the camera like the old camera API.)
thanks
source share