Howto make Video monitoring

Video
monitoring HowTo

Author:  Van hees Michel <michel_AT_vanhees.cc>

Contributor:  

Release supported: e-smith SME 5.6

License: color=#ff0000>GPL
Last updated:

Wednesday,
April 03, 2002 08:49 AM

 


Problem:  You want to make video
monitoring on your E-Smith

Solution:
  Follow this HowTo


Resources:
http://lea-linux.org/hardware/webcam.php3
PLEASE
READ!


STEP 1: On your SME 5.6 probe your webcam
:

modprobe videodev

Depends on your webcam install type one of the
following

modprobe stv680 or modprobe cpia(See this
list) or modprobe ov511 (See
this list)

#
modprobe videodev


# modprobe stv680 or modprobe cpia or modprobe ov511

STEP 2: size=2> Install vidcat RPM

Available href="modules.php?op=modload&name=CmodsDownload&file=index&req=viewdownloaddetails&lid=129&ttitle=vidcat-0.7.2-2.i386.rpm">here

Make test to be sure, every thing working fine

Other format type(jpg,png) are not working

# rpm
-ivh --nodeps vidcat-0.7.2-2.i386.rpm


# vidcat
-d /dev/video0 -s 320x240 > test.jfif


STEP 3: Install Motion 2.6.3 (Source
: http://motion.sourceforge.net)


Availabe href="modules.php?op=modload&name=CmodsDownload&file=index&req=viewdownloaddetails&lid=127&ttitle=motion-2.6.3-1.i386.rpm">here

Motion take photo when it detect some movement
in front of your webcam.

After installing RPM, config example are in /usr/local/etc/

You need to launch motion from the directory
where the config file are.

#
rpm -ivh --nodeps motion-2.6.3-1.i386.rpm

STEP 4:  Install mpeg_encode

Available href="modules.php?op=modload&name=CmodsDownload&file=index&req=viewdownloaddetails&lid=128&ttitle=mpeg_encode-1.5b-4.i386.rpm">here

Motion can make mpg file of all pictures take,
mpg_encode is needed.


Uncomment line #mpeg_encode yes in the config
file

#
rpm -ivh --nodeps mpeg_encode-1.5b-4.i386.rpm


STEP 5:  Making template of config
file


Create new directory
for the template


Copy the example
of the config file

#
mkdir -p /etc/e-smith/templates-custom/etc/motion.conf


# cp /usr/local/etc/motion.conf
/etc/e-smith/templates-custom/etc/motion.conf/


# /sbin/e-smith/expand-template
/etc/motion.conf


STEP 6:  Create startup script

Create a shell script
in your startup directory


Include the following
line :

#!/bin/sh

# Description : Starts and stops an video survey

#/etc/rc.d/init.d/motion

MOTION_CONFIG_FILE=/etc/motion.conf

. /etc/rc.d/init.d/functions

case "$1" in

start)

KIND="MOTION"

echo -n $"Starting $KIND services: "

modprobe videodev

sleep 5

modprobe stv680

sleep 2

daemon /usr/local/bin/motion -f $MOTION_CONFIG_FILE -D

echo

;;

stop)

KIND="MOTION"

echo -n $"Shutting down $KIND services: "

killproc /usr/local/bin/motion

sleep 4

rmmod stv680

sleep 2

rmmod videodev

echo

;;

status)

status /usr/local/bin/motion

;;

*) echo "Usage: $0 { start,stop,status}"

exit 1

esac

exit 0

Adapte
line modprobe stv680 and rmmod stv680 with the parametre for your webcam

#
pico /etc/rc.d/init.d/motion

# enter the script <CTRL-o><CTRL-x>

# ln -s /etc/rc.d/init.d/motion /etc/rc.d/rc7.d/S99motion

# ln -s /etc/rc.d/init.d/motion /etc/rc.d/rc6.d/K02motion

# chmod
ugo+x motion


STEP 7:  See result

Motion create many
subdirectory beginning with ./[year]/[month]/[day]


Movie are placed in that directory.

Some more directory may exist, it contains pictures.


 

Category: 
Howtos pour E-Smith/SME