Android Mobile Phone as a Webcam using DroidCam App (described for Xiaomi phones but applicable to any android)

  2 weeks ago

Prequisits - Android Phone with version compatible with DroidCam ; Computer with Linux Mint


Courtsy - DroidCam (by Dev47Apps)


This 12 step (but easy) procedure will help you to connect your Mobile Phone as Web Cam
1) If you are using MI / android phones , go to playstore and install app - DroidCam (by Dev47Apps)

Now lets set your USB to transmit camera images.
2) For this,  go to -->  Settings ---> About Phone ---> Click 7 times on 'MIUI Version' ---> you will be informed that - Now You Are Developer
3) Once you are Developer, again go to -->  Settings ---> Additional Settings --> Developer options --> Switch on USB Debugging --> And then, go to Select USB configuration ---> Set it to PTP (Picture Transfer Protocol)

4) Install & set DroidCam -

To install DroidCam on your computer, open a terminal and copy paste following entire code as one line --

sudo apt-get install xed cheese adb gcc make linux-headers-`uname -r` && cd /tmp/ wget && echo "957e5ff9e1762d0e912ee43a5f9083bb" | md5sum -c -- && unzip -d droidcam && cd droidcam && sudo ./install


To run DroidCam, type in terminal : droidcam >/dev/null 2>&1

Alternatively you can create a desktop launcher ;

Right click on desktop --> Create a new launcher here --> Name - droidcam --> Command - droidcam --> Comment - Connect Mobile As Webcam --> OK

5) From your mobile, open DroidCam --> give all required permissions ---> Check the port number displayed.
6) Connect mobile with USB cable , Select connection option as Transfer Photos (PTP)
7) On MOBILE, ensure that DroidCam APP is open
8) Now on your computer, open any webcam application like VLC, Skype, Cheese, etc and click on DroidCam icon created on your desktop
9) Select option USB (over adb) --> Note Phone IP & Port --> Click Connect
10) To check if connection is sussessful, you can check it with your web browser. In browser type in Phone IP:Port and you should be able see the mobile phone camera feed.
11) Note - DriodCam expects that you will keep your Mobile in Horizontal position while using it as webcam. Thus your picture in computer will look tilted but when you adjust the orientation of phone to horizontal, it will be good !!!
12) Or if you are nerdy , you can rotate image in VLC like this --- Ensure mobile is connected as Camera ---> Open VLC --> Go to Media --> Open Capture Device -->  Capture Mode --> Video Camera --> select appropriate video Device name e.g.-- /dev/video0 --> Then imgae will start showing in Horizontal Setting --> Further go to --> Tools --> Effects and Filters --> Video Effects --> Geometry --> Click on TRANSFORM --> Select appropriate Rotation (e.g. 90 degrees in my case) --> Save !!!