- Home /
[WebCamTexture] Require high resolution (1280*720) yields Green Screen
I want to use WebCamTexture to show the preview window of camera in Android Device (which has only one camera). If I use the default resolution (640*480), everything work fine.
However, If I change the resolution to 1280*720, I get the weird green-screen image (as shown in the attached file). It seems that the image from camera had been transferred to grayscale, assigned only to green value, and divided into 4-parts...
Here is my code:
public class UnityWebCamAPI : MonoBehaviour
{
[SerializeField] private GUITexture displayedGUITexture;
private WebCamTexture photoCamera;
private void Awake()
{
// Initialize Camera Devices.
this.photoCamera = new WebCamTexture(1280, 720);
this.photoCamera.Play();
}
private void Start()
{
this.displayedGUITexture.texture = this.photoCamera;
}
I'm using Unity 4.6.1f1. I'm sure the camera can support the 1280*720 (which has been proven by another APP written by Android API). Any ideas?
Thanks,
Joshua P. R. Pan
[1]: /storage/temp/53170-screenshot-2000-07-27-21-34-47.png
Answer by Joshua P. R. Pan · Sep 02, 2015 at 07:14 AM
I'm sorry, it seems to be our own problem. We're not using the normal Android devices, instead we use our customized android devices which return green-screen-like image back to unity as high resolution preview required.
Joshua P. R. Pan
Your answer
![](https://koobas.hobune.stream/wayback/20220612002052im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Cam texture stopped working in Unity 5/Android Lollipop 0 Answers
problem accessing webcamtexture.videorotation angle on windows phone 8 0 Answers
WebcamTexture stretching too much 1 Answer
OpenCVForUnity Core.Flip function not working in Unity Android Build 0 Answers
WebCamTexture resolution and cropping problem on Android 0 Answers