How to use your mobile camera as an HD webcam for PC?

ยท

4 min read

I recently figured out how to connect my mobile camera with my laptop and I would like to share it with you folks.

The first step is to visit DroidCam Website and install DroidCam on your mobile as well as PC. Now start your mobile hotspot and visit http://192.168.43.1:4747 on your PC to verify that the mobile device is streaming properly.

But this was just the stream. You still can't use it in Google Meet or Zoom !! To fix this, start the DroidCam application you installed on your PC and connect it to your phone by providing the IP address and port number shown in the mobile app. For Linux users, it should be similar to this :

DroidCam-Linux-Client.png

Press the connect button and your laptop and mobile will be connected. Now, we just need to change the default camera to use our brand-new mobile camera.

To select this as your default camera in the browser, visit Browser Settings

For other Desktop applications like that of Zoom, you might have to set the default camera from the settings page of that application.

Thank you for reading till here. I have got some bonus content for the Youtubers and geeks like me!

Bonus 1 - For Youtubers :

Connecting the mobile camera with OBS (Most popular software for Livestreaming)

  1. Install DroidCam OBS App (not the same as the previous one) on your android device.
  2. DroidCam OBS PC plugin on your PC.
  3. Open OBS, click at the '+' button in the sources section, choose 'DroidCam OBS' and you are good to go!

Here's a screenshot of OBS :

OBS-Studio-Hashnode.png

Damn !! This isn't software, this is Inception ๐Ÿคฏ

Bonus 2 - For Geeks :

Recording the stream using python

import cv2
stream_uri = 'http://192.168.43.1:4747/video?320x240'

vcap = cv2.VideoCapture(stream_uri)
fw = int(vcap.get(3)) # Stream width
fh = int(vcap.get(4)) # Stream height
out = cv2.VideoWriter('output.mp4',cv2.VideoWriter_fourcc(*'MP4V'), 20.0, (fw, fh))

while vcap.isOpened(): # Read frames till stream is open
    flag, frame = vcap.read()
    if flag:
        out.write(frame)
    else:
        raise Exception("Something went wrong with the source.")

Note : The stream IP '192.168.43.1' is your mobile's IP address and might change depending on the network. But it will be visible in the DroidCam app on the main screen for your reference.

Let me know through the comments if my article was helpful or if it fed your curiosity. ๐Ÿ˜‰