Skip to content

About

Use your iPhone as a 1080p USB webcam on Linux — no Wi-Fi, no subscription

Resources

Stars

11 stars

Watchers

1 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iPhone Webcam for Linux

Use your iPhone as a 1080p USB webcam on Linux — no Wi-Fi, no latency, no subscription. Works with Zoom, Meet, OBS, Teams, browsers, and any V4L2-compatible app.

iPhone (IP Camera Lite)
      │  USB cable
      ▼
  iproxy (USB tunnel)
      │  HTTP/MJPEG  127.0.0.1:8081
      ▼
  ffmpeg  ──►  /dev/video2  (v4l2loopback)
                    │
                    ▼
         Zoom / Meet / OBS / ...
               "iPhone Cam"

Requirements

Linux packages

sudo apt install ffmpeg v4l2loopback-dkms v4l2loopback-utils \
                 libimobiledevice-utils usbmuxd
Package Role
ffmpeg decodes the iPhone stream and writes it to the virtual camera
v4l2loopback-dkms kernel module that creates /dev/video2
v4l2loopback-utils v4l2loopback-ctl — pins the video format for reliable reconnects
libimobiledevice-utils idevicepair — pairs your iPhone over USB
usbmuxd iproxy — tunnels HTTP over USB (no Wi-Fi needed)

iPhone app

IP Camera Lite (free, App Store).

Recommended settings:

  • Resolution: 1920×1080 (Settings → Video → Resolution)
  • Username / Password: admin / admin (default — or update iphone-cam.sh)

Install

git clone https://github.com/theophile-wallez/iphone-webcam-linux.git
cd iphone-webcam-linux
chmod +x install.sh
./install.sh
source ~/.zshrc   # or ~/.bashrc

The installer checks dependencies, copies the script to ~/.local/bin/iphone-cam, and adds the cam helper to your shell.

First-time iPhone pairing (once per device)

# plug in iPhone, unlock it, tap Trust
idevicepair pair

Usage

cam           # start — pick "iPhone Cam" in your app
cam status    # tunnel / ffmpeg / device state
cam log       # live logs  (Ctrl-C to exit)
cam stop      # stop everything

cam runs in the background — terminal stays free, stream survives terminal close.


Configuration

Edit the top of iphone-cam.sh:

LOCAL_PORT=8081    # USB tunnel port
DEVICE_PORT=8081   # port IP Camera Lite listens on
CAM_USER="admin"   # app username
CAM_PASS="admin"   # app password
STREAM="video"     # "video" = MJPEG (stable). "live.flv" = H.264 (lower bandwidth)
VCAM="/dev/video2"
FPS=30
RES_H=1080         # output height. 720 = lower latency, 1080 = sharper

How it works

  1. iproxy tunnels TCP port 8081 from the iPhone to 127.0.0.1:8081 over USB — no Wi-Fi required.
  2. ffmpeg reads the MJPEG stream, scales it to RES_H (preserving aspect ratio), and writes raw YUYV frames to /dev/video2.
  3. v4l2loopback exposes that device as "iPhone Cam" — indistinguishable from a real webcam to any app.

Why the module reloads on every cam: v4l2loopback with exclusive_caps=1 flips the device to capture-only after a producer closes, causing the next ffmpeg to fail with VIDIOC_G_FMT: Invalid argument. Reloading resets this; v4l2loopback-ctl set-caps then pins the exact resolution as the first opener, making every ffmpeg restart reliable.


Troubleshooting

Symptom Fix
idevicepair validate fails Unplug/replug, unlock iPhone, tap Trust, re-run idevicepair pair
Tunnel failed Open IP Camera Lite on the iPhone before running cam
iPhone Cam not in app Run cam status; if ffmpeg isn't running, check cam log
Choppy video Lower RES_H to 720, or try STREAM="live.flv"
v4l2loopback busy on start Close the app using the camera, then run cam again

Manual usage (without the helper)

./iphone-cam.sh start    # foreground — Ctrl-C to stop
./iphone-cam.sh stop
./iphone-cam.sh status

License

MIT — see LICENSE.

About

Use your iPhone as a 1080p USB webcam on Linux — no Wi-Fi, no subscription

Resources

Stars

11 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages