Installing the dependencies

First of all you need to install some dependencies:

sudo pacman -S scrcpy dkms v4l2loopback-dkms

Then you need to load the module:

sudo modprobe v4l2loopback exclusive_caps=1

Usage

Camera Sharing

For using the front camera, first enable usb debugging in your phone, then connect your phone via cable and run this command in terminal:

scrcpy --video-source=camera --camera-size=1920x1080 --camera-facing=front --v4l2-sink=/dev/video0 --no-playback --no-window

For the back camera just change --camera-facing=front to --camera-facing=back .

Testing camera

Just open obs, or run this command:

ffplay /dev/video0

Mic sharing

For microphone you can run this command:

scrcpy --no-video --audio-source=mic --no-window

This would share your phone mic as system audio.

Resources