r/AndroidStudio • u/GNUGradyn • May 02 '22
Using the OBS Virtual Camera in the android emulator
Hello, I am trying to use the virtual camera built into OBS as a camera in the android emulator. However the android emulator does not appear to recognize this as a camera. It works in programs like Teams, but not android studio. Attempting to do so just results in the camera not appearing in the emulator at all (e.g. if i set the front camera to webcam0, only the rear camera is available. If I set both to webcam0 the camera app just crashes altogether)
Has anyone had success using the OBS Virtual Camera as a camera for the android emulator?
1
u/Ordinary_Presence991 Sep 03 '24
Good afternoon friend, could you do a step by step? because I'm a beginner.
1
u/Not_Michelle_Obama_ Feb 06 '25
For future duckduckgo-ers:
The problem I experienced in Windows:
Essentially, after a fair amount of digging, I determined that:
You cannot set the front camera and back camera to the same input.
In android studio, in the device manager, in the three dot menu, you can click show on disk. This will take you to a folder which contains config.ini. You can change "webcam0" to "webcam1", HOWEVER this will only work if you have more than one PHYSICAL webcam. The OBS virtual webcam doesn't seem to register. You can go into windows camera settings in order to determine how many webcams it recognizes.
My solution, ultimately, was to set the config file to "webcam1", attach an HDMI cable from my video card, into a usb capture card, and plug the USB capture card back into my computer, thus creating a second physical webcam using a monitor as an input. In OBS, under "scene" I selected "full screen projector" and selected my capture card as the monitor output. In this way, I routed an OBS scene to a "monitor", which was actually a capture card, and the capture card converted the signal to be a USB webcam.
1
u/disposable-guy Apr 22 '25
Sorry to revive an old thread, anyone any tips on getting this to work with MuMu?
0
1
u/VsemMira Feb 25 '26
Поделитесь и со мной, как это сделать... На эмуляторе андроид не работает камера obs
1
u/Evening-Catch8521 Jan 04 '23
this worked for me on mac:
obs 28.1.2
start the virtual camera. it will ask for some permission. grant it. this should be for creating the virtual camera.
edit the emulator's
config.inifind
config.iniin~/.android/avd/<your_device>.avd/config.iniadd or change the line
hw.camera.back=webcam1
restart emulator
the in-emulator camera shows the obs logo if the virtual webcam is off
notes:
webcam0 seems to be the 1st hardware camera, which is the built-in camera.
webcam1 was the external usb webcam before installing the OBS virtual camera. This didn't start working right away after installing OBS virtual camera. Seems I needed to change the emulator camera to virtualscene, then back to webcam1 for it to see the OBS virtual camera.
good luck.
1
u/ShineHistorical7626 Mar 12 '24
1
u/Novel-Ask2268 Sep 05 '24
I can't make it work with Mac M1 with Sonoma; I have a green screen instead of OBS virtual camera. Did you try your solution on sillicon chips with Sonoma?
1
1
1
u/russellwyner Feb 22 '23
On my computer, it was webcam5. To figure out what number webcam your OBS virtual camera is, you can run this command in terminal. It will return a list of all your camera names by number...
ffmpeg -f avfoundation -list_devices true -i ""1
u/Taki7o7 Aug 15 '23
somebody knows how to get that working with obs virtual camera on obs v29?
tried all webcam0 - webcam9 but no luck
1
1
1
u/arjunq21 Nov 02 '23
It does not seem to be working on m1 mac. Can you suggest where I might have gone wrong?
1
u/Baby_bitchhs Mar 13 '23
My Obs-studio is not recognizing the Obs-studio virtual webcam, what do I do? :(
1
u/Ivanovich- Aug 02 '23
Use OBS 26.1.0 https://github.com/obsproject/obs-studio/releases/tag/26.1.0 and the plugin VirtualCAM https://obsproject.com/forum/resources/obs-virtualcam.949/
(OBS 28 can't hold that plugin)
1
u/Ok_Pen_715 Nov 04 '23
Nothing works
1
u/Hefty-Employer-3933 Nov 19 '23
Are you on Windows too ?
1
u/DivideSimple9637 Nov 22 '23
Linux and nothing works fuck our lives
Missing the simplicity of farming with my dad1
1
u/younex01 Dec 30 '23
I used the bluestacks to emulate the android phone and i try manycam and obs both work when i go to the camera in the emulator work perfectly by when i go to the browser of the android emulated the camera not working any solution?
1
1
u/DesperateBig3090 Oct 17 '24
I used the same thing, bluestacks and OBS works fine but the video is in portrait on the default camera but landscape everywhere else

2
u/coeseta Aug 05 '22
Not sure if this is to late but i tried to do this for the last 30 hours and finally managed to get it running. I even have 2 solutions. The only thing i found on the internet was people that looked for a similar solution and some people saying that it won't work. Happy to prove them wrong.
I tested VMs and emulators like Genymotion, Android_x86 (via Virtualbox, VMware and Qemu), Bluestack,... Solution 1: Since I am on Linux I got it running with the following components:
OBS Studio (to stream the picture/video)
v4l2loopback (creates a virtual webcam device that will be used by OBS)
Android Studio (brings an emulator with tons of device options, i picked a Pixel 4 with play store support, since this has hardware acceleration and even brings arcore package)
qemu/kvm (hardware acceleration for android studio)
Solution 2: What I successfully tested on Windows:
Splitcam (brings the virtual webcam and provides a way to stream pictures/videos)
Bluestack (provides an android VM)
Solution 1 might also work on Windows but i didn't test that yet, I am just happy that i have a working setup now and I hope that this will help others.
Tipps:
What might be also important to mention, start the virtual webcam first and then the android emulator, otherwise it won't get recognized, also you have to select the virtual webcam in the android emulator options.
On Windows it might be neccessary to deactive all other webcams/virtual webcams for Bluestack to recognize the correct webcam device. You can do that in the Windows Device Manager.
Hope this helps :)