Webcam Notes - theunissenlab/lab-documentation GitHub Wiki

Webcams are identified by their ID. The rules are indicated in webcam.rules and copied to /etc/udev/rules.d on the computers. If one webcam was to be added, those files would need to be changed. And then you should check that the simulinks are correct under /dev: video_box# are indeed simulinks to the correct webcams!

mjpg_streamer for webcams

This command will start up a webserver on the specified port that shows a simple html page with an embedded video stream. The html page and associated javascript can be edited to provide whatever we want (and should!)

Replace the "#" sign in the next command with the appropriate box number

BOX=# && mjpg_streamer -i "/usr/local/lib/input_uvc.so -d $(readlink -e /dev/video_box$BOX)" -o "/usr/local/lib/output_http.so -p 808$BOX -w /usr/local/www" 2>/dev/null &

Then open a new tab in firefox and look at the camera at this url: BOX=# && firefox -new-tab http://192.168.0.102:808$BOX/stream_simple.html or BOX=# && firefox -new-tab http://localhost:808$BOX/stream_simple.html

To remotely access the webcams via ssh

First your machine must be able to ssh the computers down in NWAF (see system folder notes). Then ssh chubbyninja behind the scene and make your port correspond to the one of chubbyninja using the following commands: ‘ssh -fN -L 8085:localhost:8085 -L 8086:localhost:8086 chubbyninja’ Then same thing for pumpkin’s ports: ‘ssh -fN -L 8082:localhost:8082 -L 8083:localhost:8083 pumpkin’ you can know go to your internet browser and visualize the webcam streaming using the following command where the ‘#’ sign is replace by the appropriate box number: ‘http://localhost:808#/stream_simple.html'