ict.ken.be

Delivering solid user friendly software solutions since the dawn of time.

Add webcam stream to ipfire

Categories: Network

Things to remember

  • Ipfire default web interface is on http port 81 or https port 444
  • Add .1 to version in /opt/pakfire/etc/pakfire.conf and do┬ápakfire update --force so you can install addons from testing branch
  • Use pakfire to install motion
  • Motion by default streams on port 2500, but you can set this in /etc/motion.conf
  • Needed to add a video user and video group
  • The boot file /etc/init.d/motion needs some adjustments to allow starting motion at boot time
  • Set firewall rule correct to forward the port: From any to firewall red for tcp on port 2500 for webcam

Posts that helped me on the way

Adjustments to motion configuration

/etc/motion.conf

mkdir -p /var/motion/cam1
chown -R video: /var/motion/cam1
mkdir -p /var/run/motion/
chown video:video /var/run/motion/
chmod 755 /var/run/motion/
loadproc sudo -u video /usr/bin/motion

Move snapshots to dropbox

/etc/motion.conf

on_picture_save /etc/init.d/dropbox/up-snapshot.sh %f %Y%m%d %H%M%S

up-snapshot.sh

/etc/init.d/dropbox/du.sh upload $1 cam1/$2/$2-$3-snapshot.jpg && rm -f $1

Sync dropbox to main website on ipfire

sync.sh

rm -rf /srv/web/localhost/html/
/etc/init.d/dropbox/du.sh download html/ /src/web/localhost/
find /srv/web/localhost/html -type f -exec chmod 644 {} \;
find /srv/web/localhost/html -type d -exec chmod 755 {} \;

up-missing.sh

find /var/motion/cam1 -type f -exec sh -c './du.sh upload {} cam1/{}' \;