Page 1 of 1

How to use your phone as a webcam

Posted: Sat Apr 30, 2022 1:42 pm
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 1368 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.


Re: How to use your phone as a webcam

Posted: Sun May 01, 2022 6:02 am
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/


Re: How to use your phone as a webcam

Posted: Sun May 01, 2022 9:43 am
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 1290 times

Re: How to use your phone as a webcam

Posted: Sun May 01, 2022 6:13 pm
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.