Recent Android phones support UVC, which is the same protocol used by webcams. Pixels for example support it.
Linux
A community for everything relating to the GNU/Linux operating system (except the memes!)
Also, check out:
Original icon base courtesy of lewing@isc.tamu.edu and The GIMP
Via USB, your options are extra software on the PC or jailbreaking the phone to install a kernel module. (edit: that kernel module would be the UVC one, seems like some phones ship it already)
The easiest solution is streaming the image over the network.
If you're connected by USB then Android phones support ethernet over USB adapters, so you can make the computer present a network connection over the USB cable (internet sharing over USB) for more stable streaming.
For a wifi option, you can use Droidcam with OBS. Setup the virtual camera inside OBS and you've got a wifi webcam that you can walk around with.
I've used that setup many times and it's sweet. At work my coworkers are all astonished and amazed when I use the OBS virtual camera pass-through to my virtual desktop to walk around while talking (I use a wireless headset for the audio). I can even show various overlays of my desktop with my face and a downcam I have setup for demonstrations (like a craft cam setup).
Combine it with RVC voice changing silliness and they're all blown away. The security folks (of which I'm a part, haha) always freak out a little bit when they see me share my Linux desktop when I'm on Teams via the company's virtual desktop. "That shouldn't be possible!" Haha
I don't have the heart to show them how you can copy and paste huge amounts of text into the virtual desktop directly (clipboard sharing is disabled and prohibited 🤣).
I'm not sure when they added it and it might only be some phones (I have a pixel 9 pro), but you can just plug your phone in via USB and use the USB mode notification to switch it to webcam mode
Wow, I didn't know that scrcpy offered so much more than screen mirroring. Finally I can dismiss Droidcam! ٩( ๑╹ ꇴ╹)۶
- Bring live video from your smartphone, remote computer, or friends directly into OBS or other studio software.
- We use cutting edge Peer-to-Peer forwarding technology that offers privacy and ultra-low latency
It's definitely possible. I had to use this once or twice, so I didn't put much research into it and used Droidcam, which can be used via USB as well as WiFi. It works, but it's not open source, more of a freemium model. I'm sure there's an open source solution somewhere for doing that (seeing as it shouldn't be too technically difficult, for all I can tell, just more of a niche thing).
Macs can do this with iPhones... natively. I can tell either of my Macs to take a picture from my iPhone, and it'll just do it. I'm not sure why that is a thing (e.g. if my iPhone isn't in my hand, it's not pointing at anything I want a shot of), but it is. Also, they make clips that attach the iPhone to the top of the Mac(Book) and point the screen away from you, letting its 2-3 cameras point at you, looking over the screen at you.
So if Apple does it, the big Android/Windows/Linux players want to make it an option, too. Fortunately this has been a thing (on the Apple side) for a couple years now, so, even before I skimmed the comments, I thought, "I should fucking hope so."