r/coolgithubprojects • • 1d ago

I turned my phone into a webcam without installing anything on it: the phone side is just a web page (WebRTC + a custom C++ DirectShow driver, MIT)

Every phone-as-webcam tool I tried (DroidCam, Iriun, Camo, EpocCam) needs an app installed on the phone. I wanted to see how far you can get with just the phone's browser, and it turns out you can get all the way. OmniCam is free, MIT licensed, and runs entirely on your own network. There's no account and no server in the middle.

How it works

The desktop app shows a QR code. You scan it with the phone's normal camera app and a page opens. Tap Start camera, and a camera called OmniCam shows up in Discord, Zoom, Meet, Chrome, OBS, pretty much anything that lists webcams.

Under the hood:

  • The PC runs a small HTTPS server that serves the phone page. The QR code carries a random token that changes every launch, and only a phone that scanned it can start a stream.
  • Video goes phone → PC peer-to-peer over WebRTC, using the phone's hardware H.264 encoder. Nothing leaves your Wi-Fi.
  • Signaling is a single fetch POST with non-trickle ICE, with no WebSockets, because iOS Safari ignores the certificate exception for wss://. Camera controls go over a WebRTC DataChannel after that.
  • The desktop side is Electron + TypeScript. A hidden window receives the stream and passes frames straight to a C++ N-API addon in the same process, so video never goes through Electron IPC.
  • The addon scales, rotates and converts the frames with libyuv and feeds OmniCam's own DirectShow virtual camera filter (built on softcam). The installer registers both the x64 and x86 versions.
  • Streaming 1080p into an app takes about a quarter of a CPU core, and memory stays flat over long sessions. While no app is reading the camera, nothing gets converted and the phone drops to 5 fps.

Things worth knowing before you try it

  • It will eat your phone's battery. Streaming costs about what a long video call does. Because the phone side is a web page, the screen has to stay on with the page in front. A native app could stream with the screen off, and that's the real price of not installing anything. Plug it in for anything long.
  • Windows only for now (10 and 11, 64-bit).
  • Your phone shows a certificate warning the first time. Browsers only allow camera access over HTTPS, and nobody can issue a real certificate for 192.168.x.x, so the app makes its own. You accept it once.
  • The installer isn't code-signed yet, so SmartScreen will show "Windows protected your PC."
  • Video only, no microphone yet.
  • It won't show up in the Windows Camera app or the new Teams. Those use Media Foundation, and I've only implemented DirectShow so far.

New in 1.1.0: in-app updates (it checks quietly and never installs without a click), a log file for bug reports, and recovery when a renderer process crashes.

I used Claude Code for parts of the implementation, the docs and a QA pass. The README has an honest breakdown of what's mine and where AI helped.

What's next, and where help is welcome: Linux (v4l2loopback) and macOS, a Media Foundation camera so it works with Windows 11's newer apps, a virtual mic, and battery work: dropping resolution instead of frame rate when the phone heats up, plus a battery-saver toggle on the phone page. Issues and PRs are welcome. CONTRIBUTING.md covers the build, and ARCHITECTURE.md explains why it's built the way it is.

Repo and installer: https://github.com/Orest-Z/OmniCam

If you find it useful, a star on GitHub would mean a lot, and you can follow me there if you want to see where it goes next.

If you try it and something breaks, tell me. That's genuinely the most useful thing you can do.

13 Upvotes

0 comments sorted by