Linux android web camera

Can I use an Android phone as webcam for an Ubuntu device?

I found out that my Android phone’s cam has a higher quality than the one of my PC and I’m wondering if there is a way to use my phone as a webcam for the computer. Is that possible? USB (preferred), Bluetooth and LAN connections are all suitable as any other solution that doesn’t require any expense (otherwise I would just buy a webcam), but I would prefer to use only open source software if possible.

3 Answers 3

You can use any Android phone as a webcam for your Ubuntu PC by using DroidCam.

  1. First download the DroidCam app on your android device via the Play Store.
  2. Next install adb on your Ubuntu PC:
  • This page provides links to most manufacturers websites: http://developer.android.com/tools/extras/oem-usb.html#Drivers.
  • You can also search Google “ADB Drivers for ___”

For more information on how to set up DroidCam, click here.

To use your android phone as a microphone, check out WO Mic.

To install the Linux client see this.

You will also need to download the WO Mic app from the PlayStore.

Theoretically you can use both WO Mic and DroidCam in conjunction to turn your Android device into a webcam with a microphone.

According to their site, this is video only, no mic. Is there a simply way to make the mic work as well ??

Yes, I did — even double-checked them to be sure. The v4l2loopback_dc module is not installed, as I said above. It is a 64 bit system & I did the step for that as well. Isn’t the info I posted above about the FATAL error pointing to what I’ve just said as well ?? Thanks.

It worked for me with a newer cellphone. For older phones (such as mine Samsung galaxy S3) which Droidcam is not compatible, there is also a solution with IPcamera, but I have not been able to make it work in Ubuntu 20.04. Here are the details: github.com/bluezio/ipwebcam-gst/issues/100

To fix the «quality» problem I installed the latest OBS (26.1.2) using snap since it includes a virtual camera feature by default, used IP Webcam on my phone and added that as an OBS camera source. Another advantage of this approach is that I can custom-crop my webcam view in OBS 🙂

Apparently running OBS Studio (on your PC) can use a Smartphone (or other PC, as long as it has a current browser) as Microphone/Camera input. This requires obs studio with the «Browser Plugin», which is apparently not yet part of the linux packages. One then opens a site like https://obs.ninja/ or https://kevin.c3voc.de/ on the Smartphone, and copies the generated url as «Browser Source» into obs studio on the receiving device.

@jarno of course you can, but it doesn’t (or didn’t? have not checked since) include the «browser plugin» and therefore you cannot use obs.ninja or KEVIN to read in the microphone/camera of another device.

Not sure about microphone but for camera, there are solutions. The easiest would be ScreenStream android app (which is also a Free/Libre and Open Source software) to share the screen over network.

The solution suggested by azrdev ist pretty neat, because now OBS Studio for Linux does have the «Browser Plugin» and with this solution you can also benefit from all the other nice OBS features. Instead of using a site like obs.ninja, I installed the android app «IP Webcam» on my phone. With the app you can start «broadcasting» your phone’s video signal in your wireless network. With your computer and your smartphone in the same wireless network, you just add an browser source in OBS with the IP adress given to you by IP Webcam. And that’s it! Got it to work in about three minutes.

I installed obs-studio (version 25.0.3) from universe repository of Ubuntu 20.04, but I can not see any browser source I could add the URL to.

I installed the version from snap store and it has the Browser source, but I can’t get it show the video stream of IP Webcam, but just some kind of configuration window of it.

Yes. In OBS click the button in the bottom right saying «Start Virtual Camera». It now emulates a webcam called «OBS Virtual Camera» that you need to choose as source for the video signal in the software (Skype, discord. ) your using.

@jarno So you do see something in OBS? Did you start the streaming of the video signal in IPWebcam on your phone? When I used it, I never saw something like a configuration window. Maybe this video tutorial can give you a hint? youtube.com/watch?v=_MNFlfgKvz4

Источник

Using Android Camera as Webcam on Linux

After recently acquiring a new android smartphone, I’ve become interesting in testing the capabilities of its camera. One concept I’ve been curious to experiment with is live-streaming footage of my 3DS without the usage of a modded console, as I’ve seen this done fairly well. The first step to doing this though requires some setup, which is what I will explain in this guide. To stream footage from an android device to linux, I start with an app called IP Webcam. This allows the camera data to be sent over a network. There are two ways the data can be transferred: Wireless and USB tether. I opt for the USB method, since it should in theory reduce latency and data loss. This also prevents flooding my router with the data transfer. Note though, to accomplish this the USB tether option must be available on the android device. As far as I know this comes standard with recent Android versions (I have Android 5.1 Lollipop).

Once the stream is started, it can be access via the following local address:

Using an application such as VLC player’s network stream option to test this is often effective. Note that the IP address portion is set for a USB tether. If the device is connected via WiFi, the device’s network address will be used in its place.

To capture the stream, it needs to be directed to a video device. Packages for v4l2 (video 4 Linux), and gstreamer are required:

sudo pacmatic -S v4l2loopback-dkms gstreamer0.10-good-plugins

With this, a video loopback device must be loaded into the kernel:

Finally, gstreamer is used to direct the video stream to the loopback device:

gst-launch-0.10 -vt souphttpsrc location=’http://192.168.42.129:8080/videofeed’ is-live=true ! multipartdemux ! decodebin2 ! v4l2sink device=/dev/videoX

Note that the X in should be replaced with the number of the loopback device. In my case, since my laptop already has a webcam set to video0, the device is found in video1.

With this, the device can be used as a normal video device, such as a webcam for Skype, as an example. I plan on using this for streaming, likely by using Open Broadcast Studio for an easier setup, and live video mixing.

Источник

Arch Linux

I’m in need of a webcam and rather than buying one I’m wondering if I can just use my phone’s built-in camera. I have a Nexus 5X running Android 6.0.1. I’ve tried using the IP Webcam app along with this script, but the script didn’t appear to work; I could view the stream fine in browser though.

Last edited by TriforceOfKirby (2016-02-26 00:19:45)

#2 2016-02-19 16:49:12

Re: [SOLVED] Can I use my Android phone’s camera as a webcam?

I haven’t looked at the script, so I have no idea what it is supposed to do, but ‘doesn’t appear to work’ is not helpful. How are you calling the script? What output (if any) is displayed? Does the script have a verbose mode?

Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

#3 2016-02-19 19:54:50

Re: [SOLVED] Can I use my Android phone’s camera as a webcam?

Oh sorry, here’s the output when I try to run it from a terminal:

$ ./prepare-videochat.sh (standard_in) 1: syntax error ./prepare-videochat.sh: line 219: [: too many arguments (standard_in) 1: syntax error ./prepare-videochat.sh: line 220: [: too many arguments ./prepare-videochat.sh: line 272: [: =: unary operator expected ./prepare-videochat.sh: line 272: [: =: unary operator expected * daemon not running. starting it now on port 5037 * * daemon started successfully * error: protocol fault (couldn't read status length): Success * daemon not running. starting it now on port 5037 * * daemon started successfully * error: protocol fault (couldn't read status length): Success * daemon not running. starting it now on port 5037 * * daemon started successfully * error: protocol fault (couldn't read status length): Success Failure: Module initialization failed

The script is supposed to make the device recognized as a regular webcam.

Last edited by TriforceOfKirby (2016-02-19 19:57:15)

#4 2016-02-19 21:22:45

Re: [SOLVED] Can I use my Android phone’s camera as a webcam?

Yes, you can. I used to do that before. For the purpose I used droidcam:

It should work with wireless and usb, although I mostly used it with USB.
I haven’t played with it from a long time, but it worked.

Personal spot :: https://www.smirky.net/ :: Try not to get lost!

#5 2016-02-19 22:08:30

Re: [SOLVED] Can I use my Android phone’s camera as a webcam?

Yes, you can. I used to do that before. For the purpose I used droidcam:

Linux client:
https://aur.archlinux.org/packages/droidcam/

Play Store client:
https://play.google.com/store/apps/deta … s.droidcam

It should work with wireless and usb, although I mostly used it with USB.
I haven’t played with it from a long time, but it worked.

AUR package is out of date. Also it seems it can only do 720p; I’d like to do at least 1080p (my phone supports up to 4K).

Last edited by TriforceOfKirby (2016-02-19 22:20:15)

#6 2016-02-19 22:21:09

Re: [SOLVED] Can I use my Android phone’s camera as a webcam?

Let me be more specific. Here’s a very ugly PKGBUILD I just modified to work with the latest version:

# Maintainer: Daniel Nagy pkgname=droidcam pkgver=6.0 pkgrel=3 _kver="`uname -r | cut -d"." -f1,2`-ARCH" pkgdesc='A tool for using your android device as a wireless/usb webcam' arch=('x86_64') url='http://www.dev47apps.com/' license=('custom') depends=( 'bluez-libs' 'gtk2') makedepends=( 'linux-headers' ) options=('!strip') optdepends=('v4l-utils: Userspace tools and conversion library for Video 4 Linux' 'xf86-video-v4l: X.org v4l video driver' ) install="$pkgname.install" source=("$pkgname.desktop" ) sha1sums=('f85b3f34f98908bd1327df0ea0e650dcbdcb07e9') ## as of 2013-10-29 these hash sums worked. But as of 2014-02-03 somethings changed and ## the new hash sums are listed below. ## [[ "$" = "i686" ]] && _arch="x86" && sha1sums+=('64fad1b28169f1f5a3cdd03175fac5973fe5d0ef') ## [[ "$" = "x86_64" ]] && _arch="x64" && sha1sums+=('982ecb2fb2c30adc2fb7f3a2c250ce65b5d40777') [[ "$" = "i686" ]] && _arch="x86" && sha1sums+=('5b00632275a2c09551d1c72703732150b1f685fe') [[ "$" = "x86_64" ]] && _arch="x64" && sha1sums+=('09ae94cb7557ec0469759338c7b47e1afd380784') #source+=("http://www.dev47apps.com/files/50/droidcam-v4l2-$.tar.gz") source+=("https://www.dev47apps.com/files/600/droidcam-64bit.tar.bz2") package() < # Install droidcam binary file cd $mkdir -p "$"/usr/bin install -m755 "$srcdir"/$-64bit/$pkgname "$pkgdir"/usr/bin/$ install -m755 "$srcdir"/$-64bit/$pkgname-cli "$pkgdir"/usr/bin/$-cli # Install the desktop icon and ".desktop" files install -dm0755 "$/usr/share/" # install -m0644 "$/$-64bit/icon2.png" "$/usr/share/pixmaps/$.png" install -m0644 "$/$.desktop" "$/usr/share/applications/$.desktop" mkdir -p "$pkgdir"/usr/lib/modules-load.d/ printf "videodev\nv4l2loopback\nv4l2loopback_dc" \ > "$pkgdir"/usr/lib/modules-load.d/droidcam.conf mkdir -p "$pkgdir"/etc/modprobe.d/ printf "options v4l2loopback_dc width=320 height=240" \ > "$pkgdir"/etc/modprobe.d/droidcam.conf # Install doc install -dm0755 "$/usr/share/licenses/$" install -m0644 "$/$-64bit/README" "$/usr/share/licenses/$pkgname/README" # Install modules cd $srcdir/$pkgname-64bit/v4l2loopback sed -i -e "s,vdev->current_norm,//vdev->current_norm,g" "$srcdir"/$pkgname-64bit/v4l2loopback/*.c make _extramodules="extramodules-$(uname -r | cut -f-2 -d'.')-$(uname -r|sed -e 's/.*-//g')" MODPATH="$/usr/lib/modules/$/" install -Dm644 v4l2loopback-dc.ko "$MODPATH/v4l2loopback_dc.ko" >

Here’s what I did to make my 1080p Galaxy S2 work with the desired resolution:

 0 « root » /home/smirky/stuff/ABS/droidcam » modprobe v4l2loopback_dc # pressed tab for bash-completion height width 0 « root » /home/smirky/stuff/ABS/droidcam » modprobe v4l2loopback_dc height=1080 width=1920 0 « root » /home/smirky/stuff/ABS/droidcam » modinfo v4l2loopback_dc filename: /lib/modules/4.4.1-2-ARCH/extramodules/v4l2loopback_dc.ko license: GPL author: Vasily Levin, IOhannes m zmoelnig , Stefan Diewald, Anton Novikov description: V4L2 loopback video device depends: videodev vermagic: 4.4.1-2-ARCH SMP preempt mod_unload modversions parm: width:frame width (int) parm: height:frame height (int) 

I tested the preview with vlc.

Источник

Читайте также:  Unable to locate package kali linux full
Оцените статью
Adblock
detector