Skip to content
This repository has been archived by the owner on Jan 29, 2018. It is now read-only.

Settings: Remote Webcam

Peter van der Walt edited this page Aug 1, 2016 · 7 revisions

In order to use a remote Pi / Web camera:

Note: Instructions below are for using a camera plugged into a Raspberry Pi (whether the same Pi as you run LaserWeb from or not, is irrelevant. This feature merely downloads an "image" from the URL provided, once every 250ms and uses that as an overlay image on the bed:

NB NOTE Full MJPEG and VIDEO streams are NOT supported - since we need static images to overlay onto the bed as threejs textures. MJPG_Streamer has a nice "snapshot" feature which gives us single frame images.

Install MJPG_Streamer - from the JacksonLiam repository since it supports Raspberry Pi Cameras

  • SSH to your Pi
  • sudo apt-get install libjpeg8-dev imagemagick libv4l-dev
  • sudo ln -s /usr/include/linux/videodev2.h /usr/include/linux/videodev.h
  • cd /home/pi
  • git clone https://github.com/jacksonliam/mjpg-streamer.git
  • cd /home/pi/mjpg-streamer/mjpg-streamer-experimental
  • make clean all
  • sudo make install
  • sudo cp -R www /usr/local/www

Next, install and configure the RPI Camera as usual: NOTE this should also work with any USB webcam that support V4L

Instructions: https://www.raspberrypi.org/documentation/configuration/camera.md

  • Run MJPG_Streamer
LD_LIBRARY_PATH=/home/pi/mjpg-streamer/mjpg-streamer-experimental /usr/local/bin/mjpg_streamer -i "input_raspicam.so -fps 15 -q 50 -x 640 -y 480" -o "output_http.so -p 8080 -w /usr/local/www" & 
  • Test that MJPG_Streamer can display your Pi Camera:

Open a browser and access: http://192.168.1.100:8080/?action=snapshot (replace 192.168.1.100 with the IP of your Pi) It should show a single photo from your pi camera. Press f5 to refresh the page and get an updated view as you move something in front of camera

  • Configure a Remote Camera instance in LaserWeb3: