Turns a phone running Two Mirrors in Webcam (PC) mode into a regular webcam that Zoom, Teams, Meet, Discord, OBS, etc. can see.
- Phone opens TCP
8889and emits H.264 frames when a client connects. - This script reads the frames, decodes with PyAV (FFmpeg), and pushes them to the OBS
Virtual Camera driver via
pyvirtualcam. That driver shows up as a normal webcam system-wide on Windows.
-
Install OBS Studio (https://obsproject.com/). You don't have to use its UI — we just need the Virtual Camera DirectShow filter that ships with it. On modern OBS the filter is registered at install time; you don't need to hit "Start Virtual Camera" in OBS at all.
-
Install Python 3.10+ and the deps:
cd desktop pip install -r requirements.txtav(PyAV) bundles FFmpeg on Windows — no separate FFmpeg install needed. -
Enable USB debugging on the phone (Settings → About → tap Build Number 7×, then Developer Options → USB debugging).
-
Plug the phone in over USB. Make sure
adbis on PATH (or use--adb-path). -
On the phone, launch Two Mirrors → Webcam (PC) → pick a lens. It'll sit at "Waiting for PC…".
-
On the PC:
py twomirrors_webcam.pyThe script runs
adb forward tcp:8889 tcp:8889for you, connects, and starts the virtual camera. If multiple phones are plugged in, pass-s <serial>(seeadb devices). You should seevirtual camera active: OBS Virtual Cameraand the phone status flipping to "PC connected · streaming". In Zoom / Teams / browser pick OBS Virtual Camera as the camera source.
--host <ip>— connect directly to a phone IP (skips UDP auto-discovery). Useful when discovery can't find the phone — typically because the network blocks inter-client traffic. Pair with Tailscale (see below) if you're on a network like that.--usb— single-phone USB mode. Runsadb forward tcp:8889 tcp:8889and connects to localhost. Requires USB debugging on the phone.--no-mirror— skip the horizontal flip. By default we mirror the frame so front-facing camera text reads correctly, matching how laptop webcams behave.
UDP auto-discovery and direct TCP-over-Wi-Fi both assume the phone and PC can actually
reach each other. On corporate, university, or hotel networks that's usually not true:
client isolation blocks device-to-device traffic, and PC-side firewalls often drop
inbound UDP on port 8890. Symptoms: the script sits at "waiting for phones…" forever, or
--host <ip> can't open the TCP connection.
The fix is Tailscale — it builds an encrypted mesh between your devices that tunnels
straight through whatever firewall is in the way. Each device gets a stable 100.x.x.x
address that works from any network (home, uni, cellular).
-
Install Tailscale on the PC and each phone, sign in with the same account on all.
-
Open the Tailscale app on each phone and note its
100.x.x.xaddress. -
Run:
py twomirrors_webcam.py --host 100.x.x.x
That's it — the phone is reachable by that IP as long as both devices have Tailscale running, no matter what Wi-Fi they're each on.
Multiple phones. Pass --host once per phone (or comma-separate them). The feeds are
tiled into a single 1280×720 virtual camera — Zoom/Teams/etc. see one webcam that shows
all angles at once:
py twomirrors_webcam.py --host 100.x.x.a --host 100.x.x.b
py twomirrors_webcam.py --host 100.x.x.a,100.x.x.b,100.x.x.c
Grid layout is automatic: 2 phones = side-by-side, 3 = two-top-one-bottom, 4 = 2×2,
more = ceil(sqrt(N)) columns.
ModuleNotFoundError: No module named 'pyvirtualcam'— you didn't install requirements, or installed them into a different Python. Trypython -m pip install ….No virtual cameras found— OBS isn't installed, or its Virtual Camera filter wasn't registered. Reinstall OBS with admin rights, or runC:\Program Files\obs-studio\data\ obs-plugins\win-dshow\virtualcam-install.batas admin.- Phone says "Waiting for PC…" forever —
adb forwarddidn't run, or it ran against a different device. Re-check withadb devicesand re-run with the-sflag. - Stutter / high latency over Wi-Fi — use USB (
adb forward). Wi-Fi Direct isn't usable here because Windows doesn't join Wi-Fi Direct groups as a client.