summaryrefslogtreecommitdiff
path: root/root_scripts/webcam_config.sh
blob: d90bb85a1596f00d03663d1de3baf643d0601bac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
# Craig Jennings <c@cjennings.net>
# getyer webcam workin'

# ensure root
if ! [ $(id -u) -eq 0 ]
then
    echo "Must run as root. Exiting."
    exit
fi

# install all needed
pkg install -y v4l-utils v4l_compat webcamd pwcview

# add character device in userspace
sysrc kld_list="${kld_list} cuse"
sysrc webcamd_enable=YES

# flags are between brackets in 'webcamd -l' output.
# Example: 
# webcamd [-d ugen1.3] -N Generic-Laptop-Camera -S 200901010001 -M 0
# add that to rc.conf also
sysrc webcamd_0_flags="-d ugen1.3"

# add yourself to the webcamd group
pw groupmod webcamd -m cjennings

# start the service
service webcamd start