I'm building a custom camera to record video. The camera displays the preview correctly and records the video correctly as well. The problem is with the saved video. The recording is in the wrong orientation(sideways), and I know it's being recorded this way because I'm using a third-party app to playback the video. I've solved it temporarily with this line:
mRecorder.setOrientationHint(270);
However, I'm not sure that this will work on all devices. My question is, what's a more reliable solution to my problem?
Edit
This problem only happens when I record in portrait, when I record in landscape, the orientation is already correct and I don't have to use setOrientationHint
Edit 2
That question is about fixing the preview orientation, I've already solved that problem. My question is how to fix the recording orientation i.e. the orientation of the saved video. –