Konubinix' opinionated web of thoughts

Scrcpy Android as Webcam

Fleeting

How to Use Scrcpy on Android – AirDroid

You must install the module v4l2loopback by

sudo apt install v4l2loopback-dkms.

To create a v4l2 device: sudo modprobe v4l2loopback

To start scrcpy using a v4l2 sink:

scrcpy –v4l2-sink=/dev/videoN

scrcpy –v4l2-sink=/dev/videoN –no-display # disable mirroring window

scrcpy –v4l2-sink=/dev/videoN -N # short version(replace N with the device ID, check with ls /dev/video*)

Once enabled, you can open your video stream with a v4l2-capable tool:

ffplay -i /dev/videoNvlc v4l2:///dev/videoN # VLC might add some buffering delay

https://www.airdroid.com/remote-control/how-to-use-scrcpy-on-android/