How to use your phone as a webcam

Moderator: BarryK

Post Reply
User avatar
BarryK
Posts: 2273
Joined: Tue Dec 24, 2019 1:04 pm
Has thanked: 93 times
Been thanked: 564 times

How to use your phone as a webcam

Post by BarryK »

This can be done with DroidCam. This has three parts: an app that you install in your Android device or iPhone, a Linux executable, and a Linux kernel module.

I did a search of the forum, and see that 666philb has got it going in Fossapup:

viewtopic.php?t=1070

The only catch is, when the kernel is changed, you will have to recompile the DroidCam module. It is 'v4l2loopback-dc.ko', and to make it easy to compile, I have pulled just the module source out as a separate package, see 'droidcam-v4l2loopback-dc-1.8.2.tar.gz' attached.

I have setup the kernel build for EasyOS so that the DroidCam module will always be compiled. The same could be done for the woof-ce kernel-kit. @dimkr

EasyOS 3.4.7 has the kernel module, and the 'droidcam-cli' CLI executable. I didn't compile the GTK app. And yay, it works:

https://bkhome.org/news/202204/droidcam ... works.html

Easy has GUVCView builtin, snapshot:

guvcview-droidcam-audio2.jpg
guvcview-droidcam-audio2.jpg (66.86 KiB) Viewed 1174 times

...the green bar shows that audio is working, when I speak to the phone.

Success with OBS Studio also.

Had some difficulty at first, as Easy uses pulseaudio.

In the blog post, I reported that video is stuck on 640x480, however, I discovered that resolution needs to be specified when loading the kernel module:

https://www.dev47apps.com/droidcam/linux/

Modern phones have very sophisticated optics and processing, and work real nice as a webcam.
The only problem is, some kind of holder is needed -- plenty available.

What I would like to do next is write a little GUI, to automate all the steps that I did manually.

Attachments
droidcam-v4l2loopback-dc-1.8.2.tar.gz
(17.22 KiB) Downloaded 80 times
User avatar
April
Posts: 493
Joined: Tue Dec 29, 2020 9:06 pm
Has thanked: 57 times
Been thanked: 28 times

Re: How to use your phone as a webcam

Post by April »

Funny you should post that .
I was reading an Instructible yesterday which may be along the same lines.

It was for a foot switch to take camera pictures but I figured it would probably work if the phone was set to video as both work on the same button.
https://www.instructables.com/Smartphon ... h-Trigger/

The Australian State Governments have all enacted laws to steal your assets on your death. All legal paperwork is binned and all assets seized on one disgruntled child's complaint.Move them well before you die or go into a home.

User avatar
BarryK
Posts: 2273
Joined: Tue Dec 24, 2019 1:04 pm
Has thanked: 93 times
Been thanked: 564 times

Re: How to use your phone as a webcam

Post by BarryK »

April,
Interesting project.

A little while ago, I purchased a bluetooth button off Aliexpress, that is supposed to do the same thing. It has a rechargeable battery.
Haven't attempted to use it yet.

https://www.aliexpress.com/item/1005002767476343.html

...it does say can be used for video. I presume that a button press will start video recording, and press will stop?

shutter-remote.jpg
shutter-remote.jpg (20.07 KiB) Viewed 1096 times
User avatar
rockedge
Site Admin
Posts: 5720
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 1997 times
Been thanked: 2099 times
Contact:

Re: How to use your phone as a webcam

Post by rockedge »

I've just tested Droidcam using a cheap Coolpad cell phone to check how it would work as a netcam for Zoneminder.

It works really well and is easy to configure using the net URL and port supplied by Droidcam.

Also I found streaming it directly in a browser works well using the net IP and port of the Droidcam mobile phone.

Post Reply

Return to “EasyOS”