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


Finally after 2 day i solve my problem.
This Solution for
GrafikaContinuousCaptureActivity.javaIn
drawFrame()Method i'll change some code forportrait.I add below 2 line in
drawFramemethod:In
drawFrameMethod 2 type to set theglViewportSurfaceViewwith it. (it means this orientation change while user recording a video)So i'll be change in 2nd opetion
Please find full code at below :