Revert video to original from mirror in Android -


currently, capturing video using surfaceview, working perfect camera. but, shows mirror video output front camera. there way prevent mirror video or there way convert mirror video in again mirror video using mp4parser can original video. dont want use textureview there no hard coding prevent mirror video.

below piece of code set orientation of camera, working perfect in both face.

public static void setcameradisplayorientation(activity activity, int cameraid, android.hardware.camera camera) {         android.hardware.camera.camerainfo info = new android.hardware.camera.camerainfo();         android.hardware.camera.getcamerainfo(cameraid, info);         int rotation = activity.getwindowmanager().getdefaultdisplay().getrotation();         int degrees = 0;         switch (rotation) {         case surface.rotation_0:             degrees = 0;             break;         case surface.rotation_90:             degrees = 90;              break;         case surface.rotation_180:             degrees = 180;             break;         case surface.rotation_270:             degrees = 270;             break;         }          if (info.facing == 1)         {             degrees = (360 - (info.orientation + degrees) % 360) % 360;         } else         {             degrees = ((info.orientation - degrees) + 360) % 360;         }          camera.setdisplayorientation(degrees);     }  

setdisplayorientation(degrees) change orientation of images/live video rendering on screen

mediarecorder -> setorientationhint(degrees) change orientation of video stored in file.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -