USB Webcam

About

There different ways to use webcam connected to Carambola. I will shortly overview some of them.

motion

You are likely to use this package if you want standalone security server.

Add support for kernel usb video support

Select packages:

make menuconfig
  • Kernel modules
    • Video Support
      • kmod-video-core
        • kmod-video-cpia2
        • kmod-video-gspca-core
        • kmod-video-pwc
        • kmod-video-sn9c102
        • kmod-video-uvc
        • kmod-video-videobuf2
make

Use

  1. Install motion opkg install motion
  2. Edit: vi /etc/motion.conf
  3. To test, type motion and open <carambola_ip>:8081 to see picture from webcam

mjpg-streamer

This tool helps stream live video from webcam.

Notes

You need camera which supports UVC (list)

By default camera can be accessed from LAN interface. It is not available on WAN port.

Compile custom image

make menuconfig

Select:

  • Kernel modules
    • Video Support
      • Select all if unsure
make

Flash new compiled image.

Installing

Open terminal to carambola

opkg update
opkg install mjpg-streamer

Setup

mjpg_streamer gets configuration from /etc/config/mjpg-streamer file, which by default looks like:

config mjpg-streamer core
      option device           "/dev/video0"
      option resolution       "640x480"
      option fps              "25"
      option port             "8080"
      option enabled          "true"

Startup & using

It starts with system.

If you wish, you can start mjpg_streamer manual way:

1. Kill running instance:

killall -9 mjpg_streamer

or

kill -9 `pidof mjpg_streamer`

or

/etc/init.d/mjpg-streamer stop

2. Run it

mjpg_streamer -i "input_uvc.so -d /dev/video0 -r 1600x1200 -f 25" -o "output_http.so -p 8080"
mjpg_streamer -i "input_uvc.so -d /dev/video0 -r 640x480 -f 25" -o "output_http.so -p 8080"
mjpg_streamer -i "input_uvc.so -d /dev/video0 -r 854x480 -f 25" -o "output_http.so -p 8080"

3. Open browser or ip stream viewer (like VLC or something else) and see video

http://<carambola_ip_address>:8080/?action=stream

or if you wish single image.

http://<carambola_ip_address>:8080/?action=snapshot

fswebcam

This tool is to grab pictures from web camera.

Install

Add USB webcam support as mentioned in motion

Install fswebcam

opkg update
opkg install fswebcam

Edit configuration file

vi /tmp/fswebcam.conf

add text

device /dev/video0
input 0
loop 15
skip 20
background
resolution 640x480
set brightness=60%
set contrast=13%
jpeg 95
save /tmp/viewcam.jpg
palette MJPEG

Run

In order to run and capture once type:

fswebcam --device /dev/video0 output.jpeg

If you wish to alter resolution type:

fswebcam -d /dev/video0 -r 1600x1200 output.jpeg

Save picture with todays date and time

fswebcam -d /dev/video0 -r 1600x1200 /mnt/picture-`date +%d-%m-%y-%H-%M-%S`.jpeg 

In order to start deamon type:

fswebcam -c /tmp/fswebcam.conf

In order to running daemon type:

killall -9 fswebcam

Get image

You can simply get image by accessing it using scp