You need to see the direction of rotation, and then rotate the preview of the captured input, this can be done by turning the preview in real time.
int rotAngle = -webCamTexture.videoRotationAngle; while( rotAngle < 0 ) rotAngle += 360; while( rotAngle > 360 ) rotAngle -= 360;
The following code from the Camera Capture Kit is the plugin that we use for ( https://www.assetstore.unity3d.com/en/#!/content/56673 ) - we use it for a social game / application so that the user can accept and Share photos inside the game.
You also need to flip the image when in some cases the rotation is 270 or 90 degrees. This is the code for Android.
if( Application.platform == RuntimePlatform.Android ) { flipY = !webCamTexture.videoVerticallyMirrored; }
You need to consider these factors when rendering a webcam preview, and when receiving pixels, the image pixels must also rotate if you want to save and share them, this is an expensive process that needs to be done frame by frame in the preview, so you need to do This is after the photo was taken once.
Greetings
Chris
source share