r/AndroidStudio • • 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?

30 Upvotes

59 comments sorted by

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 :)

2

u/breh2022 Sep 21 '23

Hey I have been trying to get this to work for days. I downloaded a fresh copy of linux and followed all your instructions.

Started virtual cam up on OBS and launched AVD. The camera app crashes and doesn't recognize the virtual cam at all. I tried webcam0 all the way up to webcam5.

I started the cam first then the emulator. Still crashes or shows nothing.

I'm really at a loss here, I'm a freelancer and use Android for my job. This would definitely help me out a lot if you could share any help. Thanks!

2

u/FredPannekoek Oct 04 '23

Running into the same issue. Did you manage to solve it?

1

u/MyOtherBodyIsACylon Mar 09 '23

What version of android were you able to get with working with?

1

u/coeseta Jul 11 '23

I used an Android 10 VM

1

u/Baby_bitchhs Mar 13 '23

My Obs-studio is not able to recognize the virtual webcam of Obs-studio :(

1

u/F0LEY Aug 10 '23

Thanks from the future!

1

u/DivideSimple9637 Nov 22 '23

Hey from the future did you got it working bro

1

u/F0LEY Nov 22 '23

Yes, it was a little silly, but I used OBS virtual cam as a source on Splitcam, and then chose splitcam as the cameera on the emulator: It worked like a charm. a hacky-duct-taped charm, but a charm none the less

1

u/Mukun00 Sep 22 '25

Now splitcam too crashes, So I have to use manycam

1

u/DivideSimple9637 Nov 23 '23

Thank you so much bro you really helped me on this one

1

u/F0LEY Nov 23 '23

Heh glad to help, also thanks again to OP!

1

u/ART777ART Jul 17 '24

i sent you message about this
still having same problem
how did you manage to chose splitcam as the camera on the emulator ?

1

u/Mukun00 Sep 22 '25

try manycam

0

u/[deleted] Aug 11 '24

[deleted]

1

u/F0LEY Aug 12 '24

I'm sorry, that was almost a year ago. I don't remember the ins and outs of what I did anymore.

1

u/Trick-Practice1800 Sep 27 '23

Do you know any way to go through "video selfie" checks, I'm doing a project to prove the security of face ID verification?

1

u/mojojojo_999 Oct 06 '23

Yeah, use deepfake and android virtual camera

1

u/IDmachines Jan 02 '25

what does it take to check the feed for the remote proofing, do you spoof the actual device camera ID in any way?

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:

  1. You cannot set the front camera and back camera to the same input.

  2. 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.

  3. 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

u/[deleted] Oct 03 '25

[deleted]

1

u/Jumpy_Ganache_7534 Nov 02 '25

found on memu

1

u/likeabowse Feb 04 '26

can you share boss!

1

u/VsemMira Feb 25 '26

И со мной пожалуйста

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.ini

    • find config.ini in ~/.android/avd/<your_device>.avd/config.ini

    • add 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

[WORKED - THANKS] On Mac Default was webcam0 i made front cam webcam1 and now its working fine. Just change in the config.ini and do not mess up in the AVD settings. once you edit your config.ini then simply run the emulator.

I am using: Pixel_6:5554

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

u/Scary_Appearance7220 Nov 26 '24

webcam1 saved my life. Thank you.

1

u/Rude_Guarantee_3800 Jan 23 '23

what emulator did you use?

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

u/Educational-Cat7954 Sep 03 '24

Maybe ffmpeg is not updated, try:

brew update

brew upgrade ffmpeg

1

u/Due_Fix420 Aug 29 '23

Really appreciated it. It fucking worked lol

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/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 dad

1

u/SirRichardTheFirst Jan 25 '24

OBS virtual camera

im here

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

u/Budget_Nature_878 Jun 25 '24

same issue i have faced if u have any solution please let me know

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