Skip to content
aramg edited this page May 3, 2021 · 7 revisions

To use droidcam on Raspberry PI, you need to compile it from source.

Here is the list of steps (originally written by kichel98):

  1. For testing purpose, install droidcam on a phone. After you enter IP number that is shown in app into the browser's address bar, you should see image from your camera.

  2. In order to use droidcam, you need to install libjpeg-turbo. Download it from this link and extract. Inside the /tmp directory is best if you don't care about keeping the sources. Execute these commands

cd {extracted-libjpeg-turbo-source-directory} #example: cd /tmp/libjpeg-turbo
cmake -G"Unix Makefiles" .
make

Try 'cmake -G"Unix Makefiles" -S .` if you get path not found errors.

You can then either run sudo make install to install directly, or make deb to create a deb package and install that instead: sudo dpkg -i libjpeg-turbo_XXX.deb. The deb package option is nicer since you can later update or remove libjpeg-turbo using dpkg.

In the end, you should have

/opt/libjpeg-turbo/include  # turbojpeg.h will be here
/opt/libjpeg-turbo/lib32    # libturbojpeg.a will be here
  1. Now we can install droidcam, according to instructions on GitHub.
  • download droidcam from GitHub
  • install linux-headers by executing sudo apt install raspberrypi-kernel-headers
  • install required dependencies (warning: gtk is huge library used to GUI).
  • go to droidcam source directory
  • make droidcam-cli, and make droidcam for GUI client
  • ./install-client
  • sudo ./install-video (compiles and installs DroidCam version of v4l2loopback, its also possible to use the standard v4l2loopback)
  • run ./droidcam-cli <ip> <port>, instead of <ip> and <port> type data shown on your phone

If everything went well, you should be able to take a photo: fswebcam image.jpg