motion-3.2.8 Video Surveillance application [Compiled and created on Puppy Linux 2.17.1 with devx_217.sfs loaded, and then packaged as a dotpet using dir2pet]. Author: William McEwan (mcewanw). Revision 1 dated: 11 Sept 2007. I have created a new dotpet for the Motion video surveillance application. This dotpet, motion-3.2.8.pet, is for the current version of motion (as of Sept 2007) and includes ffmpeg support (so it can produce avi videos as well as jpegs) but not mysql support. If you have mysql installed on your system, and would like motion to use that, it is a simple matter to recompile the application (just follow the steps below; the straightforward compilation procedure will automatically detect your mysql libraries). For my compilation, for ease of later upgrade, I have faithfully kept to the installation procedure, and associated install directories, recommended at motion's website: http://www.lavrsen.dk/twiki/bin/view/Motion/InstallOverview For the moment, you will find the new dotpet, motion-3.2.8.pet, via the link provided at the bottom of this thread message. ---------------------------------------- This motion-3.2.8.pet archive stores the following files and directories on your system: /usr/local/motion-3.2.8 /usr/local/motion [symbolic link to /usr/local/motion-3.2.8] /usr/local/etc/motion.conf /usr/local/etc/motion-dist.conf /usr/local/etc/motion/motion-3.2.8compile_notes.txt /usr/local/apache2/htdocs/cam1 [default location for captures] /usr/share/applications/motion.desktop /root/.motion/motion.sh ---------------------------------------- Though, you simply need to install the dotpet to get motion working correctly (assuming your webcam driver is already installed), I have briefly detailed below the procedure I used compiling the package (just prior to producing the dotpet). Hopefully, this may help you should you wish for any reason to recompile the application yourself. Please refer to my earlier "HOWTO:Manually get your webcam and/or TV card working" (at: http://www.murga-linux.com/puppy/viewtopic.php?t=21464) for more general information concerning getting your webcam itself working. That howto also points you to an older version of motion, motion-3.1.19.pet, should you want to try that as an alternative. Note, however, that motion-3.2.8 provides superior facilities to motion-3.1.19 and is equally easy to use. My compilation steps follow for your information (but remember, you don't need them, just install the provided dotpet...): cd /usr/local wget -c http://prdownloads.sourceforge.net/motion/motion-3.2.8.tar.gz?download tar -xvzf motion-3.2.X.tar.gz [or use, for example, Xarchive to decompress the tar.gz to /usr/local] ln -s motion-3.2.8 motion [a symbolic link made for convenience] cd motion [Note: now in directory /usr/local/motion-3.2.8] ./configure make make install ----- RESULT OF make install: ************************ * Configure status * ************************ OS : Linux pthread Support: Yes jpeg Support: Yes V4L included: Yes V4L2 supported: Yes FFmpeg Support: Yes MYSQL Support: No PostgreSQL Support: No ----- Note: When you run it, the motion program automatically looks in /usr/local/etc/ for the text file motion.conf (its configuration file). Since you now have a backup (motion-dist.conf), you can edit motion.conf as much as you desire. Refer to motion's website for details of motion.conf's format: http://www.lavrsen.dk/twiki/bin/view/Motion/MotionGuideGettingItRunning [At this stage I edited /usr/local/etc/motion.conf and changed "the Start in daemon (background) mode" parameter to off] INSTALLING THE DRIVER MODULE FOR YOUR WEBCAM If you haven't already done so, you should now install the driver module for your webcam. For example, I installed vabene06's dotpet: gspcacav1-20070508-i586.pet, which automatically places the correct driver module for my own webcam, gspca.ko, into /lib/modules/2.6.21.5/kernel/drivers/usb/media. You can get vabene06's dotpet from forum thread: http://www.murga-linux.com/puppy/viewtopic.php?mode=attach&id=5467 Then you need to register the new driver module with the system and load it and the videodevice up by entering the commands: depmod -a modprobe videodev modprobe gspca [the above line will need altered to refer to your own driver module] You can now start the motion video surveillance application by entering: /usr/local/motion-3.2.8/motion [or simply: /usr/local/motion/motion because of the symbolic link made earlier Note that, an intermediate shell script, /root/.motion/motion.sh, is used in the final dotpet to start the applicaton]. On detecting motion, the jpeg and/or avi images will by default be captured into /usr/local/apache2/htdocs/cam1. You can change that behaviour by editing /usr/local/etc/motion.conf, altering the line starting with the words target_dir to point to wherever you want to store the jpegs etc. When running in this non-daemon mode you can stop motion running by pressing Ctrl-C. You can alternatively always stop it by finding the process id using, for example, either top or ps, and entering: kill Apart from editing /usr/local/etc/motion.conf, to whatever behaviour you desire, everything is now installed. You should, if you wish, consult motion's website manual for details regarding the alterable configuration parameters in motion.conf. You will find the complete manual at: http://www.lavrsen.dk/twiki/bin/view/Motion/MotionGuide For your convenience, however, the dotpet I produced to avoid your having to go through all the above steps :-)includes a JWM Menu icon and entry: Menu > Multimedia > Motion-3.2.8 Video Surveillance That menu item calls up a tiny shell script I have written, /root/.motion/motion.sh, which runs the motion application from a new rxvt shell (unless daemon mode has been turned on in motion.conf). Enjoy! ------ Further notes: PRODUCING THE DOTPET You might be interested in how the actual dotpet itself was produced. After compiling motion-3.2.8 and getting it all working, I created another empty directory called motion-3.2.8 elsewhere on my system (anywhere I had space). Then I created a dummy directory structure mimicking where I wanted the bits and pieces of motion to end up. That is, I created: (a) [dummy]motion-3.2.8/usr/local/ and (b) [dummy]motion-3.2.8/usr/local/etc/ [dummy] here just stands for the actual path where I stored the originally empty container directory motion-3.2.8 I then copied the tested-as-working /usr/local/motion-3.2.8/ directory into (a), and /usr/local/etc/ into (b) [only the bits to do with motion] Finally, I created the file motion-3.2.8.pet by entering the command: dir2pet [dummy]motion-3.2.8 [I basically chose the defaults to any questions asked by dir2pet, though I selected menu icon mini-eye.xpm, when asked for such]. Good luck making your own dotpets too!