Need a webcam for your Linux system? This guide shows you how to use your phone as a webcam using IP Webcam and v4l2loopback.
Prerequisites
- Android phone
- Linux system (examples use Arch Linux)
- Both devices connected to the same network
Download and Set Up IP Webcam
-
Install IP Webcam from the Google Play Store.
-
Open the app and scroll down to find Start server
-
Tap Start server - the app will display a URL like:
1http://192.168.100.6:8080 -
Note this IP address for later use
Install Required Packages
Install the necessary dependencies on your Linux system:
|
|
Create Virtual Camera Device
Load the v4l2loopback module to create a virtual webcam:
|
|
Verify the device was created:
|
|
Add your user to the video group for proper permissions:
|
|
Important: Log out and log back in for the group changes to take effect.
Test the Connection
Verify your phone’s video stream is accessible:
|
|
Replace 192.168.100.6 with your phone’s IP address. You should see live video in your browser.
Stream to Virtual Camera
Choose one of the following methods based on your preference:
Method A: MJPEG Stream (More Compatible)
|
|
Method B: H.264 Stream (Better Quality)
|
|
Keep this command running while you want to use your phone as a webcam.
Use in Applications
Your phone camera will now appear as IPCam in video applications like:
- Zoom
- Google Meet
- OBS Studio
- Discord
- Any application that supports V4L2 devices
Bonus: Automation Script
Create a convenient script to automate the process. Save this as ~/.local/bin/ipcam:
|
|
Make it executable and run:
|
|
Troubleshooting
Stream not working?
- Ensure both devices are on the same network
- Verify the IP address in the URL
- Try another decoding method.
Permission denied on /dev/video10?
- Make sure you’re in the video group:
groups $USER - Log out and back in after adding to the group
Poor video quality?
- Try the H.264 stream (
/videoendpoint) - Adjust video settings in the IP Webcam app
- Check network bandwidth
Conclusion
You now have a high-quality webcam using your Android phone. This setup provides better video quality than some built-in laptop cameras and gives you the flexibility to position your camera anywhere within your network range.
Also, if you don’t have a webcam on your laptop/PC, this is a great alternative. Enjoy your new webcam setup!
For more details, please refer to the links below.