this post was submitted on 15 Jul 2024
34 points (100.0% liked)

Linux

1259 readers
92 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

DroidCam is a freemium application which allows you to use your phone as a web camera (thus getting a better picture quality for meetings than ordinary webcams)

So, needless to say, it's very helpful.

Now, I have been facing a number of issues with this application for a few days and I felt it would be best if I just share stuff regarding how I make it work seamlessly, it won't look good when you are late for a meeting because you are troubleshooting droidcam, so here's how I use it.

  1. v4l2loopback package can cause a lot of problems, so, I would suggest you to download it from source, you can do that using this script given below (this also installs droidcam on your linux computer)

This isn't the most efficient script there is, but it works.

First, run the command

vim installation_droidcam.sh && chmod +x installation_droidcam.sh

(you might have vi editor installed by default, so if you don't have vim, just replace vim with vi, if neither are available, run sudo apt install vim, I personally use featherpad)

Now, paste the below script into your text editor (this doubles as a reinstallation script too, but if you want the latest and greatest, you would have to replace the installation commands of droidcam given below with whatever is available here on the official website

#!/bin/bash

cd ~

pkill droidcam

sudo /opt/droidcam-uninstall

# installation script for droidcam
# if you want the latest version, go to
# https://www.dev47apps.com/droidcam/linux/
cd /tmp/
wget -O droidcam_latest.zip https://files.dev47apps.net/linux/droidcam_2.1.3.zip
# sha1sum: 2646edd5ad2cfb046c9c695fa6d564d33be0f38b
unzip droidcam_latest.zip -d droidcam
cd droidcam && sudo ./install-client
# end of installation script


cd ~

sudo rm -r v4l2loopback

pkill droidcam


gh repo clone umlaeute/v4l2loopback

cd v4l2loopback

make && sudo make install $ sudo depmod -a

cd ~

sudo modprobe v4l2loopback

Now, save the script and exit it.

Everything required for droidcam to work has been installed on your laptop (you would still have to install Droidcam (green) on your android device and set it up over there tho, I am not gonna guide with that)

Here's a video for that by Mental Outlaw

Now, you would have to edit the desktop entry for droicam on your laptop to include sudo modprobe v4l2loopback command, because this needs to be running for droidcam to work. So, to do that, we will create another script

run vim /home/$USER/droidcam_start_menu_libre_desktop_file.sh && chmod +x /home/$USER/droidcam_start_menu_libre_desktop_file.sh and paste the below script and save it

#!/bin/bash

sudo modprobe v4l2loopback

/usr/local/bin/droidcam

After this, menulibre if you don't have it already by doing sudo apt install menulibre and edit the desktop file entry for droicam such that it looks like the image below (make sure you Tick Run in Terminal) as you need to have v4l2loopback running in the background for droidcam to work.

In the command text box, you much have /home/$USER/droidcam_start_menu_libre_desktop_file.sh (location of the script we just created) and now save it.

And that's it!

From now on, you would be able to start droidcam (while keeping droicam on on your android device) The terminal would open, enter your password and you can now connect and use your phone as a second camera (a much better second camera)

I haven't been very articulate, so doubts are welcome

desktop entry should look like this

top 21 comments
sorted by: hot top controversial new old
[–] Strit@lemmy.linuxuserspace.show 19 points 4 months ago (2 children)

Android 14 has the option to present itself (the phone) to a computer as a USB webcam. Very handy and does not require any special software on the PC.

[–] Subject6051@lemmy.ml 9 points 4 months ago* (last edited 4 months ago) (1 children)

With every new version, I lost some liberty to do something I like in the name of security. I am not exactly excited over newer versions of android :(

[–] GolfNovemberUniform@lemmy.ml 3 points 4 months ago (1 children)

Android is dying imo, especially AOSP. A14 has serious source code issues afaik and I don't think anyone dares to say they're not intentional.

[–] ReversalHatchery 3 points 4 months ago (1 children)

What kind of source code issues do you mean? This is the first time I hear this and I'm interested

[–] GolfNovemberUniform@lemmy.ml 1 points 4 months ago

Idk what exactly is going on there but custom ROM devs are talking about it a lot. The issues I noticed are mostly UI and animation glitches but there can be other things in the backend.

[–] boredsquirrel@slrpnk.net 7 points 4 months ago

True! Over USB

[–] Ghoelian@lemmy.dbzer0.com 11 points 4 months ago (1 children)

Your script uses gh, which I think is the github cli, to clone a repository.

It would be easier for most people to just do a git clone git@github.com:umlaeute/v4l2loopback (or git clone https://github.com/umlaeute/v4l2loopback). I don't really understand why you'd use gh for something as simple as a clone tbh.

[–] beeng@discuss.tchncs.de 1 points 4 months ago

Do you need to setup config.username\email with gh clone repo

Maybe you don't even need that for git pull?

Only thing I can think of.

[–] mactan@lemmy.ml 7 points 4 months ago (1 children)

everything about cams kinda sucks, hope the pipewire camera project can address most of it

[–] Subject6051@lemmy.ml 2 points 4 months ago (1 children)

hey, what ya mean? Droidcam is actually perfect for me, I use it for Zoom, video calls, meets, you name it!

The only issue was reliability and I apparently just had to have v4l2loopback running in the background, and I solved that by creating a script and running that script to open Droidcam

[–] boredsquirrel@slrpnk.net 7 points 4 months ago (1 children)

This loopback kernel mod stuff is not needed with Pipewire. Thats the biggest issue here.

[–] Subject6051@lemmy.ml 2 points 4 months ago (1 children)

With every new version, I lost some liberty to do something I like in the name of security. I am not exactly excited over newer versions of android :(

ohh... thanks! I will look into it!

[–] boredsquirrel@slrpnk.net 1 points 4 months ago

I like that Android is way more reliable than any Laptop OS I ever used.

But true, it is very uncustomizable.

[–] thepiguy@lemmy.ml 7 points 4 months ago (1 children)

I just use scrcpy. They have instructions on their github.

[–] Subject6051@lemmy.ml 4 points 4 months ago (1 children)

wot!? Scrcpy can double as a webcam, God, kill me now.

I have been using scrcpy to open the phone so I can turn on droidcam on it! :')

[–] thepiguy@lemmy.ml 4 points 4 months ago (1 children)

XD yea. scrcpy --video-source=camera --no-audio --v4l2-sink=/dev/video0 --no-playback this is the command I use. There are a few more config options for orientation and to select the camera.

[–] Subject6051@lemmy.ml 2 points 4 months ago

hey, thank you very much!

[–] boredsquirrel@slrpnk.net 4 points 4 months ago (1 children)

Remote Video Camera (Stream video/audio between two phones. Zero configuration.) https://f-droid.org/packages/org.avmedia.remotevideocam/

[–] Ghoelian@lemmy.dbzer0.com 7 points 4 months ago (1 children)

That one seems to only do remote streaming over network. Droidcam can be used over a USB connection as well, which works much more reliably (than the wireless version of droidcam, at least) in my experience.

[–] boredsquirrel@slrpnk.net 1 points 4 months ago* (last edited 4 months ago)

@jumuta@sh.itjust.works

Strange, I remember there was an app for creating a video stream on Android