I want to use the camera in one of my projects. So I'm using the camera of my emulator device but the problem is when the camera is on its show's some weird animation i.e a box is moving all over the screen. What is the solution for this?
Thanks
This is not a problem. This is the default behavior of the Emulator's Camera.
I suggest using any real device to achieve this since there is no way to "simulate camera in the Android emulator using the webcam" except by extensively modifying the Android firmware.
Source
Yes, Emulator camera cannot be used if there is no access to webcam. I have downloaded GenyMotion emulator which solved my problem.
Thank you for your support.
Related
So, for whatever reason the camera on my unity project build on android is black. I don't believe this is a coding issue considering the fact that it works perfectly fine on my pc with a normal webcam. I'm using unity 2021.1.0f1.
I figured it out. Turns out all I had to do was go into settings and turn on the camera permissions/restart the app. Even though I already allowed it in the app, guess it caused an error when a camera wasn't detected straight away.
I've built the app and compiled it with VR enabled and cardboard selected as my VR device. I can install and run it on my phone (Samsung S8) BUT the in game camera is stuck in portrait mode and the yew is inverted (turning my head left turns the camera right). I have scoured the internet but still can't find a way to fix this.
I've enabled VR in playersettings and added google cardboard as my VR.
I've also disabled portrait views under orientation.
I've set the camera as both a child and parent object.
I've built the app with both cardboard and daydream selected as the VR (and each individually) but still the same issue.
I've tried forcing different higher levels of API requirement
I have added and removed GvrEditorEmulator from the project and the GvrControllerMain and no luck.
I've even flipped the camera manually by a 180 degrees and this made the view be in landscape but in this case the pitch was inverted (when I look up the camera looks down) and I haven't found a way to resolve this.
In the editor view the screen looks fine, but every time I run it on my Android phone it force starts in portrait mode and the pitch or yew is inverted.
Is there a hidden option I need to switch, does anybody have more suggestions that I could try?
You can see what the app looks like when I hold the phone i portrait mode on the link bellow (the image breaks when I try to add it to the post for some reason).
https://imgur.com/a/o80NRe4
Its worth mentioning that I'm working with Unity version 2019 2.0b2 because any other version I tried would not detect my installed Android SDK and would not let me build the project. I've tried on multiple machines and always had that problem so I'm afraid of attempting an upgrade to a newer version would break my build ability.
This seems to be a known and reported issue for Google VR SDK for unity. Its been reported on their github page.
The only possible fix is reverting back to Unity 2018.3.14f1. I did this by exporting my v2019 project, then creating a new 2018.3.14f1 version project and importing the original into it. This rebuilds the project and should avoid conflicts if you're lucky.
I am not such a professional coder but trying to code something on Unity. However, when I try to play the application in my android phone, the half of the screen does not seem to work correctly, please look at the photo: http://i.imgur.com/J7Bgn5i.png & http://i.imgur.com/aV3aeyh.png
Can you guess what the reason is for that?
Up to now, I have changed screen resolution but it did not solve my problem.
Edit: It works perfectly in my android tablet. However, as I said, I have this problem in my LG G3 android phone.
Thanks for your help!
After changing Main Camera setting according to this photo: , I have solved my problem.
Has anyone gotten the CWAC Camera (https://github.com/commonsguy/cwac-camera) to work with a Genymotion emulator (http://www.genymotion.com/)?
I can't get the preview to actually start. It works fine on a regular device. Would be awesome if I could get it working for the sake of speeding up development.
Did you enable the camera feature?
To do so you need to open the camera widget and then enable it as shown here:
I'm using HTC sensation for testing.
the version of Android is 2.3.4.
and there are two cameras on this device.
I could open camera separated (do preview NOT at same time).
BUT, once, if I try to open camera at same time.
I'll got a RuntimeException - Fail to connect to camera service for front-facing camera.
does anyone have idea ??
According to Android Camera Api,
Your application should only have one Camera object active at a time
for a particular hardware camera.
So I guess it should not be possible.