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: preview. The Linux app and the virtual camera are tested on Arch Linux with Hyprland. The Ubuntu, Debian and Fedora packages are new and haven’t been tested on those systems yet. The iPhone app is in beta on TestFlight.

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 comes later)
  • A Linux computer on the same Wi-Fi network as the phone
  • The v4l2loopback kernel module and the GStreamer plugins

Install

Each package installs the app, the virtual camera module (v4l2loopback) and the GStreamer plugins it needs, and sets the camera up to load at every start.

Ubuntu, Debian, Linux Mint, Pop!_OS (not tested yet)

Download the .deb (20 MB)

sudo apt install ./pocketwebcam_0.2.0_amd64.deb

With Secure Boot on, the install asks you to set a password for the kernel module. Restart and choose Enroll MOK with that password.

Fedora (not tested yet)

Enable RPM Fusion (free and nonfree) first.

Download the .rpm (29 MB)

sudo dnf install ./pocketwebcam-0.2.0-1.x86_64.rpm

Arch Linux and other distros

A tarball with an install script that uses apt, pacman or dnf, and installs the app in your home folder. The app itself is tested on Arch; this installer is new.

Download the .tar.gz (29 MB)

tar xf pocketwebcam-linux-x86_64-0.2.0.tar.gz
cd pocketwebcam-linux-x86_64-0.2.0
./install.sh

Run ./install.sh as your normal user, not with sudo: it asks for your password when it needs it.

After installing, open Pocket Webcam from your app launcher. With the .deb or .rpm, the kernel module is often built in the background on first install, so the camera may only appear after a restart.

To check that a download is complete and unchanged, compare sha256sum <file> with the published checksums.

Set up the virtual camera by hand

Only needed if you don’t use one of the downloads above, or the camera doesn’t show up after installing.

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 (from the app launcher), on the same Wi-Fi.
  2. The first time, pair them: the desktop app shows a QR code. On the iPhone, tap Pair with a computer and scan it (or pair with a 6-digit code instead). After that they connect by themselves.
  3. In OBS, your browser or a call app, choose Pocket Webcam Camera.

If discovery is blocked on your network, connect by address once the phone is paired: 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 above 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?

An AUR package (pocketwebcam-bin) is coming; until then, Arch users can use the tarball above. A Flatpak isn’t planned: it can’t install the v4l2loopback kernel module the virtual camera needs, which is the hard part of the setup.

Not on Linux?

There’s a Windows 11 preview, and an Android version comes after the iPhone launch. See the download page, or compare Pocket Webcam with Camo, EpocCam and iVCam.