#Camera Kit in Android Studio Changes Webcam Dimensions

24 messages · Page 1 of 1 (latest)

hasty raptor
#

Hi everyone! I'm encountering an issue in Android Studio. When I emulate the APK on a virtual device, the image captured by the webcam appears very poor in quality (see attached Image 1). However, when I check the native camera app of the emulated device, the image quality looks great. I'm using a Logitech Brio 4K webcam.

Does anyone know what I can do to improve the quality of the webcam image in the emulated APK? Any help would be greatly appreciated!

chilly egret
#

What emulator are you using @hasty raptor ?

hasty raptor
#

I use the Android Studio emulator, the only one that has worked for me to open APKs with the Camera Kit SDK. The emulator is abbreviated as AVD (Android Virtual Device). I used a Pixel 9 PRO XL configuration, and in the emulator's Log console, a setting indicating weight: 448 height: 997 is displayed. It seems strange to me that it appears cropped and zoomed, resulting in that pixelated low quality. I also tried creating a virtual camera with OBS, but it doesn't recognize it.

chilly egret
#

@hasty raptor are you running one of the sample apps? Or running your custom code via Android Studio?

The emulator camera might not support higher resolutions out of the box, but I can help get OBS to be recognized.

hasty raptor
hasty raptor
#

I'm interested in knowing if there is an alternative emulator that can open the APK or how you managed to get the virtual cam working in OBS.

chilly egret
#

All android emulators (Bluestacks, genymotion) can open the APK, but doesn't support Camera Kit out the box.

The Android emulator is known to be pretty low resolution when connecting to a webcam directly, but should be able to be configured to connect to a virtual (OBS) camera.

I'll be trying this on Windows in a couple days, but in the meantime take a look at this reddit thread
https://www.reddit.com/r/AndroidStudio/comments/ugwufb/using_the_obs_virtual_camera_in_the_android/

Depending on your OS, there are different approaches

Reddit

Explore this post and more from the AndroidStudio community

hasty raptor
#

Thanks

hasty raptor
#

it worked using a Video card Capture with OBS to force Android Studio use as input the custom canvas I created for OBS, but I have a new issue, the quality of the webcam looks pixelated, My webcam es a Brio MX 4K, and the screen Im using is a TV QLED 55'' I don't if the problem is the video capture output or AVD from Android Studio cannot emulate a webcam with big resolution

chilly egret
hasty raptor
#

Just im testing, my suspect is my video capture card output 1080p, is like im scaling 1080 to a big display

chilly egret
#

@hasty raptor how bad is the pixelation?

hasty raptor
#

Looks like a video 360p on youtube

#

Im testing in a small display, 1920x1080

#

In portrait mode, the AI says something that autoscale is provoked by cameraX in the kotlyn code

#

But i cannot modify that code

chilly egret
#

In portrait mode, the AI says something that autoscale is provoked by cameraX in the kotlyn code

Sorry what do you mean here?

#

you asked chatGPT a question?

hasty raptor
#

Yep

#

i cannot share links or pictures :c

#

can i send you in tm?

#

dm?

chilly egret
#

yup

hasty raptor
#

Hello i send you dm recently to check if any updates or improvements for this setup, or if can see alternatives like a webapp (i made a solicited for the same lens but adapted for webapp)