Linux

September 8th, 2010 Leave a comment Go to comments

The Linux module (prototype) is a combination of a Video4Linux2 device driver, and an executable app that will transfer the stream from the phone to the driver.

This being Linux, it’s assumed you are somewhat familiar with the system. Text in blue should be executed on the command line. Also please keep in mind other posts on the blog are Windows oriented, I will try to include all Linux related stuff here.

Install
1. You must first remove any old versions of the client you have. Scroll down to the “Removal” section below.

2. Get the package: 32-bit or 64-bit. Extract everything to the desktop or another folder within the home folder. Make sure there are no spaces in the path. Check out the README.

3. Open up the command line, cd ~/Desktop/ (or ~/whatever).
A simple shell script is included that will automate the installation process.

NOTE: The default “droidcam webcam” output resolution will be reported as 320×240 to the system.
Using a higher resolution on the phone will cause the video to be RESIZED DOWN to fit in the webcam.
If you have a fast computer, with preferably a wired connection, you can use a higher resolution for the webcam.
320×240, 480×360, or 640×480 (Normal, Medium, High respectively) are the “standard” ones.

Simply run sudo ./install [320 240] to install the client. su needed to register the device driver. 320 and 240 are optional, replace them with one of the above if you have a fast computer). If you get errors, add #include <module.h> at the top of droidcam_v4l.c in the webcam folder.

The installer creates a settings directory as ~/.droidcam. If you’re running as root, make sure you move it to your standard users home directory.

If no errors are displayed, you can ensure the device is installed with lsmod.

4. Open up a V4L compatible program and you should see DroidCam listed as a video device.

5. Start droidcam from the command line. You can also create a launcher if you’re using gnome and add it to the “Applications” menu by going to System -> Preferences. (Don’t know about kde).

6. Check the connection post on how to connect. If all goes well, you should see the output in the chat application, and you’re done! Remember to delete the extracted folder.

You can also check this if you have VLC or ‘amd64′ (ebuild) problems: http://bugs.gentoo.org/339780.

Changing webcam output resolution
See the Format Guide for extra info.
Regardless of what resolution you pick on the phone, the client will resize the frames to fit into the webcam. So if the webcam is installed with 320×240, then using a higher resolution on the phone doesn’t really help much. If you want to try different resolutions without having to re-install the client:

1. Unload the device driver: sudo rmmod droidcam_v4l

2. Re-load it as follows: /sbin/insmod /lib/modules/`uname -r`/kernel/drivers/media/video/droidcam_v4l.ko width=WIDTH height=HEIGHT (Where WIDTH and HEIGHT are numbers).

3. Edit the first line of the text file ~/.droidcam/settings so the client programs knows how to re-size the frames (specify the same resolution as in 2). Restart ‘droidcam’.

4. Test the webcam with whatever programs you wish. You can keep changing the resolution.

5. Edit the text file /etc/modules so the webcam gets reloaded with the new resolution on boot.

Removal

To remove the DroidCam client (or existing old version):

1. Close any running programs. Open the command line.

2. Unload the V4L driver: sudo rmmod droidcam_v4l

3. Delete the driver file and the client executable:
sudo rm -f /usr/bin/droidcam
sudo rm -f /lib/modules/`uname -r`/kernel/drivers/media/video/droidcam_v4l.ko

4. Get rid of droidcam and ‘videodev’ in /etc/modules using your favorite text editor. (sudo gedit /etc/modules)

5. Delete ~/.droidcam/ folder

You may wish to restart the computer.

  1. Lucifer
    April 9th, 2012 at 04:25 | #1

    okay, that didn’t work. I guess it thought I was trying to inject html or something? anyway, after the first #include it should say linux/module.h and after the second one it should say module.h

  2. kyle radke
    May 1st, 2012 at 02:11 | #2

    .deb package would be great

  3. May 5th, 2012 at 11:21 | #3

    Error 113, no route to host.

    But have route to host, have this ip address in network, all ok, but still this error.

    Maybe port on router ?

    • dev47
      May 5th, 2012 at 13:12 | #4

      What does ifconfig say? Seems your ethernet card is down or there’s something special going on.

Comment pages
1 2 3 4 12