Turn your iPhone into a high-quality webcam for your computer β truly uncompressed video when the link allows it, visually lossless when it does not, over Wi-Fi or USB.
English Β· Π ΡΡΡΠΊΠΈΠΉ
Features Β· Quick start Β· Architecture Β· Roadmap Β· Docs
ClearCam (working title; repository iphone-webcam) turns an iPhone into a webcam for a desktop computer. The
iPhone captures video and sends it to the desktop over Wi-Fi or a USB cable; the desktop app shows a live preview,
lets you control the phone, and is designed to publish the stream as a system virtual camera that Zoom, Google
Meet, OBS and recording apps can pick up.
The core idea is honest quality: send truly uncompressed video when the link can carry it, and switch automatically to a visually lossless mode (light compression you cannot tell apart by eye) when it cannot. A built-in speed test decides what fits.
Note
Work in progress. The Wi-Fi path β QR pairing, handshake, live RAW preview in the desktop app, lens switching and telemetry β is implemented in both apps and passes automated end-to-end tests against a Rust mock iPhone; on-device acceptance with a real iPhone is still pending. USB transport, the speed test and adaptive quality are implemented in the core and covered by end-to-end tests, but not fully wired into the apps yet. The virtual camera is not built yet β it is waiting for an Apple Developer ID. See the roadmap. The apps' UI is currently in Russian.
| Feature | Status | |
|---|---|---|
| π‘ | Wi-Fi pairing by QR code β the desktop shows a QR with host, ports and a random session token; the iPhone scans it (or you enter the values by hand) | β implemented |
| πΌ | Live RAW preview β NV12 frames from the iPhone camera, drop-oldest buffering, JPEG preview (β€ 30 fps) in the desktop app | β implemented |
| π· | Lens switching from the desktop β front, wide, ultra-wide, telephoto (whatever the phone has) | β implemented |
| π | Device card & telemetry β model, iOS version, battery, thermal state, sent bitrate, cameras with their max resolution and fps | β implemented |
| π | Reconnect β the session goes to reconnecting on a drop and re-attaches without restarting the desktop | β implemented |
| π | USB transport β usbmuxd via the pure-Rust idevice crate, per-device pairing keys, cable wins over Wi-Fi |
π§ͺ core + e2e tests; device list & trust UI in the desktop app |
| π§ͺ | Speed test & adaptive quality β ramp test over the media socket, table-driven mode selection, adaptation loop with hysteresis (SET_MODE β MODE_APPLIED) |
π§ͺ core + e2e tests with the mock iPhone |
| π | Hybrid quality β raw YUV 4:2:0 β visually lossless HEVC/H.264 (VideoToolbox) | β³ encoder/decoder not implemented yet |
| π₯ | System virtual camera β CMIO Camera Extension on macOS, later Media Foundation (Windows) and v4l2loopback (Linux) | β³ blocked on Apple Developer ID |
| π₯ | Cross-platform desktop β macOS first, then Windows, then Linux | β³ planned |
This is a developer build: there are no releases yet.
| Part | You need |
|---|---|
| Desktop core & shell | Rust stable (rustfmt, clippy), Tauri 2 CLI (cargo tauri) |
| Desktop UI | Node.js 20 and pnpm 10 (the versions CI uses) |
| Linux desktop | Tauri 2 system packages β libwebkit2gtk-4.1-dev, build-essential, libssl-dev, libayatana-appindicator3-dev, librsvg2-dev, β¦ (see .github/workflows/ci.yml) |
| iPhone app | macOS with Xcode (Swift 5.9, iOS 17 SDK), XcodeGen, a real iPhone on iOS 17+ |
git clone https://github.com/DenisHumen/iphone-webcam.git
cd iphone-webcam/desktop
pnpm --dir ui install
cargo tauri devClick ΠΠ°ΠΏΡΡΡΠΈΡΡ ΡΠ΅ΡΠ²Π΅Ρ (Start server): the app starts listening on random control and media ports and shows the QR code.
From the repository root:
./scripts/regen-xcode.sh # generates ios/ClearCam.xcodeproj from ios/project.yml (needs xcodegen)Open ios/ClearCam.xcodeproj in Xcode, set your DEVELOPMENT_TEAM, and run the ClearCam target on a real iPhone
(the camera does not work in the simulator). Allow camera and local-network access, scan the QR code from the
desktop, and the live preview should appear in the desktop app.
desktop/tools/mock-iphone is a Rust stand-in for the phone that completes the handshake, sends telemetry and
synthetic NV12 frames. The end-to-end tests drive the desktop core with it:
cd desktop
cargo test --workspace --all-targets
cargo run -p mock-iphone -- --help
# mock-iphone --host <host> --cport <port> --mport <port> --token <token>
# [--width N --height N --fps N --no-video --transport wifi|usb --congested]- macOS: usbmuxd is part of Apple Mobile Device support and is already there.
- Linux:
./scripts/setup-linux-usbmuxd.shinstallsusbmuxd+libimobiledevice(apt) and enables the service; check withidevice_id -l. - Windows: requires Apple Mobile Device Support (bundled with iTunes / Apple Devices). The USB path on Windows has not been validated yet (Phase 7).
The real usbmuxd backend is behind a Cargo feature β build the desktop shell with --features usb-idevice;
without it the shell uses an in-process loopback stand-in.
There is no config file yet. What you can tune:
| Setting | Where | Default |
|---|---|---|
| Log level | RUST_LOG environment variable (tracing EnvFilter) |
info,tauri=warn |
| Real USB backend | Cargo feature usb-idevice on clearcam-desktop / transport |
off (loopback stand-in) |
| USB pairing keys | pairings.toml in the OS config directory for ClearCam (via the directories crate) |
created on first trust |
| Wi-Fi ports | picked by the OS on every server start and carried in the QR code | random |
| Part | Technologies |
|---|---|
| iPhone client | Swift, SwiftUI, AVFoundation, Network.framework (VideoToolbox planned) |
| Desktop core | Rust workspace, Tokio, serde |
| Desktop UI | Tauri 2 (Rust backend) + React 18, TypeScript, Vite, Tailwind CSS |
| Virtual camera (planned) | CMIO Camera Extension (macOS) Β· Media Foundation (Windows) Β· v4l2loopback (Linux) |
| Transport | two TCP connections per session over Wi-Fi or over USB (usbmuxd via the idevice crate) |
flowchart LR
subgraph iPhone["iPhone β Swift / SwiftUI"]
CAP["Capture<br/>AVFoundation"] --> ENC["Encoder<br/>raw Β· VideoToolbox (planned)"]
ENC --> TCLI["Transport<br/>Network.framework"]
SA["Status<br/>battery Β· telemetry"] --> TCLI
end
subgraph Desktop["Desktop β Rust core + Tauri"]
TSRV["Transport<br/>Wi-Fi Β· USB"] --> CP["ControlPlane<br/>session"]
TSRV --> MP["MediaPipeline"]
CP <--> AE["Adaptive engine<br/>+ speed test"]
MP --> PV["Preview"]
MP -.-> VC["Virtual camera<br/>(planned)"]
PV --> UI["Tauri UI"]
CP --> UI
end
TCLI <-->|"control Β· JSON"| TSRV
TCLI <-->|"media Β· binary"| TSRV
Every session uses two TCP connections, so a command never queues behind a large video frame: control (length-prefixed JSON β handshake, auth, device info, telemetry, camera and mode commands, speed test) and media (a binary 28-byte header followed by the frame payload). The full contract is in docs/03-protocol.md; design decisions are recorded as ADRs in docs/12-decisions-log.md.
.
βββ desktop/ # desktop app (Rust workspace)
β βββ crates/
β β βββ ccp-protocol/ # control messages (serde) + binary media header, versions/caps
β β βββ transport/ # Wi-Fi TCP server/client, USB (usbmuxd) conductors, framing
β β βββ session/ # handshake, ControlPlane actor, keepalive, pairing
β β βββ adaptive/ # speed test, mode selection, adaptation state machine
β β βββ mediapipeline/ # media reader, drop-oldest buffering, speed-test counter
β β βββ decode/ # Decoder trait (passthrough for now)
β β βββ sink/ # Frame + FrameSink trait
β β βββ app/ # wiring: AppCore, USB supervisor, pairing store, adaptation driver
β βββ src-tauri/ # Tauri 2 shell: commands, events, preview sink
β βββ ui/ # React + TypeScript + Vite + Tailwind front end
β βββ tools/mock-iphone/ # Rust mock iPhone for tests and local runs
β βββ sinks/ # reserved for virtual camera sinks (empty)
βββ ios/ # SwiftPM package + XcodeGen project.yml
β βββ Sources/ClearCamProtocol/ # protocol types mirroring ccp-protocol
β βββ Sources/ClearCamCore/ # capture, encode, pairing, session, transport, status
β βββ Sources/ClearCamApp/ # SwiftUI app (QR scanner, connect / connected views)
β βββ Tests/
βββ docs/ # design documentation (Russian)
βββ plans/ # phase-by-phase implementation plans with acceptance logs
βββ scripts/ # dev helpers: regen-xcode, setup-linux-usbmuxd, swift-env, dev-usb
The design docs live in docs/ and are written in Russian (identifiers, protocol fields and code in
English). Start with the index, docs/README.md, and the canonical design spec,
docs/superpowers/specs/2026-05-26-iphone-webcam-design.md.
| # | Document | Topic |
|---|---|---|
| 01 | Vision & requirements | goals, non-goals, scenarios, functional and non-functional requirements |
| 02 | Architecture | components, boundaries, data flow |
| 03 | Protocol | handshake, control and media channels, frame format, versioning |
| 04 | iOS app | capture, codecs, camera switching, battery, transport, UI |
| 05 | Desktop app | Rust core modules, Tauri UI, virtual camera sinks, media pipeline |
| 06 | Adaptive engine & speed test | speed test, mode selection, bitrate math, adaptation loop |
| 07 | UI/UX | screens, states, design language |
| 08 | Project structure | repository layout, module boundaries, build |
| 09 | Tech stack | languages, frameworks, platform APIs and rationale |
| 10 | Roadmap & plan | phases, milestones, acceptance criteria |
| 11 | Testing strategy | testing across all components |
| 12 | Decisions log | ADRs: what was chosen, why, what was rejected |
| 13 | Glossary | terms |
| 14 | Apple Developer ID guide | getting a Developer ID and certificates to sign the macOS release and the CMIO extension |
Implementation follows the phases in docs/10-roadmap-and-plan.md; each phase has a
detailed plan with an acceptance log in plans/.
| Phase | Scope | Status |
|---|---|---|
| 0 β Foundation | Rust workspace, ccp-protocol, Tauri + React shell, iOS protocol package, CI |
β done |
| 1 β Transport & handshake | Wi-Fi TCP, handshake and token auth, device info, telemetry, QR pairing, reconnect | β done (on-device check pending) |
| 2 β RAW video + preview | iOS NV12 capture, media pipeline, desktop preview, lens switching | β done (on-device check pending) |
| 3 β Virtual camera (macOS) | CMIO Camera Extension, frame hand-off to the extension | β³ blocked on Apple Developer ID |
| 4 β Encoder, speed test, adaptation | adaptive engine, mode selection, decoder trait | π‘ partly: engine done; VideoToolbox encoder/decoder pending |
| 5 β USB transport | usbmuxd conductor, pairing keys, cable-wins selection, trust UI | β done (not yet tried on a real device) |
| 6a / 6b β USB session & adaptive loop | USB handshake β pipeline, adaptation driver, live speed test | β done (headless, with mock iPhone) |
| 6c β Hardware polish | VideoToolbox encode/decode, ffmpeg decoder, Wi-Fi β USB hand-over, reconnect tuning, on-device tests | β³ next |
| 7 β Windows | Media Foundation virtual camera, USB via Apple Mobile Device Support | β³ after v1 |
| 8 β Linux | v4l2loopback sink, packaging, ffmpeg/VAAPI decode | β³ after v1 |
| 9 β Audio | audio track in the protocol, virtual microphone, A/V sync | β³ after v1 |
| 10 β Multiple sources | several phones, active-source switcher | β³ after v1 |
The same gates CI runs on every push:
# Rust (from desktop/)
cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace --all-targets
# UI (from desktop/ui/)
pnpm install --frozen-lockfile
pnpm typecheck && pnpm lint && pnpm format:check && pnpm build
# iOS package (from ios/, on macOS)
swift build
swift testIf swift picks up the Command Line Tools instead of Xcode, source scripts/swift-env.sh first.
Issues and pull requests are welcome. Please read the relevant design doc first and keep to the module boundaries in docs/08-project-structure.md; new architectural decisions go into docs/12-decisions-log.md as an ADR.
License: not specified yet.