I set the device Orientation Landscape
mode then it saves the video perfectly.
if I capture a video with both sides.
But I set the device orientation Portrait
Mode this work weird.
For Example:
Below Screenshot while i Recording video :
But when i save the video and see in MXPlayer then it's look like this:
I use below code :
Display display = ((WindowManager) getSystemService(WINDOW_SERVICE)).getDefaultDisplay();
if (display.getRotation() == Surface.ROTATION_0) {
mCamera.setDisplayOrientation(90);
// layout.setAspectRatio((double) cameraPreviewSize.height / cameraPreviewSize.width);
} else if (display.getRotation() == Surface.ROTATION_270) {
// layout.setAspectRatio((double) cameraPreviewSize.height / cameraPreviewSize.width);
mCamera.setDisplayOrientation(180);
} else {
// Set the preview aspect ratio.
//layout.setAspectRatio((double) cameraPreviewSize.width / cameraPreviewSize.height);
}
UPDATE:
Also i try to add setOrientationHint where i start the MediaMuxer
portrait
mode. – Ayer