Use your iPhone as a webcam on Linux

Pocket Webcam sends your iPhone’s camera to your Linux computer over Wi-Fi and shows it as a regular V4L2 webcam: in OBS, Chrome, Firefox and video calls. Free, no watermark, no account.

Status: in development. The Linux receiver and the virtual camera work today, tested on Arch Linux with Hyprland. The iPhone app is being tested, so there is no public download yet. Join the launch list to hear when the beta opens.

How it works

  1. The iPhone app encodes the camera in hardware (H.264 or HEVC) and announces itself on your Wi-Fi.
  2. The Linux app finds the phone, decodes the video and writes it to a virtual camera called Pocket Webcam Camera (/dev/video10).
  3. Any app that can use a V4L2 webcam can pick it.

What you need

  • An iPhone with iOS 17 or later (an Android version is in development)
  • A Linux computer on the same Wi-Fi network as the phone
  • The v4l2loopback kernel module and the GStreamer plugins

Set up the virtual camera

Arch Linux and derivatives (tested)

sudo pacman -S --needed v4l2loopback-dkms v4l2loopback-utils \
    gst-plugins-good gst-plugins-bad gst-libav

Debian and Ubuntu (expected to work, not tested yet)

sudo apt install v4l2loopback-dkms v4l2loopback-utils \
    gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-libav

Fedora (expected to work, not tested yet)

Enable RPM Fusion, then install akmod-v4l2loopback together with the GStreamer good, bad-free and libav packages.

Create the device

This creates one camera named “Pocket Webcam Camera”. exclusive_caps=1 is what lets Chrome, Firefox and other WebRTC apps list it.

sudo modprobe v4l2loopback devices=1 video_nr=10 \
    card_label="Pocket Webcam Camera" exclusive_caps=1

To make it survive reboots:

echo v4l2loopback | sudo tee /etc/modules-load.d/pocketwebcam.conf
echo 'options v4l2loopback devices=1 video_nr=10 card_label="Pocket Webcam Camera" exclusive_caps=1' \
    | sudo tee /etc/modprobe.d/pocketwebcam.conf

Check that it exists:

v4l2-ctl --list-devices

Connect your iPhone

  1. Open Pocket Webcam on the iPhone and on your computer, on the same Wi-Fi.
  2. Your phone shows up in the desktop app and connects by itself.
  3. In OBS, your browser or a call app, choose Pocket Webcam Camera.

If discovery is blocked on your network, connect by address: pocketwebcam --host 192.168.1.42. Discovery uses mDNS (UDP 5353) and the video uses TCP port 7310. More in the help page.

Linux questions

Does it work on Wayland and X11?

Yes. Pocket Webcam creates a V4L2 virtual camera in the kernel, so it doesn’t depend on your display server. It has been tested on Arch Linux with Hyprland (Wayland).

Do I need v4l2loopback?

Yes. v4l2loopback is the kernel module that creates the virtual webcam your apps see. Pocket Webcam uses a single device named “Pocket Webcam Camera”.

Why doesn’t Chrome or Firefox list the camera?

The device must be created with exclusive_caps=1. Without it, browsers and WebRTC apps can’t see it as a camera. The setup below uses that option.

Does it work with Secure Boot?

Only if the v4l2loopback module is signed. DKMS modules are unsigned by default, so on Secure Boot systems you need to enroll a signing key (MOK) or turn Secure Boot off for the module to load.

Is video hardware-decoded?

Where VA-API is available, the receiver uses the GPU to decode (vah264dec / vah265dec) and falls back to software decoding when it isn’t.

Is there an AUR or Flatpak package?

Not yet. Packages for Arch (AUR) and Flatpak are planned for launch. A Flatpak will still need the v4l2loopback kernel module installed on the host.

Not on Linux?

Windows is next, and an Android version is in development. See the download page, or read how it works on the home page.