Dotpet Package of Motion (Webcam Video Surveillance)
Posted: Wed 05 Sep 2007, 12:48
EDIT 15 Oct 2013: Note well that the attached dotpets are for very old versions of Motion. Some more recent compilations of motion can be found later in this thread and probably elsewhere on the forum.
Dotpet for motion-3.2.8 Video Surveillance application
plus mini-howto on its compilation and construction
Author: William McEwan (mcewanw). Revision 1, 10Sept2007
[ Please also refer to the new Puppy Linux Wiki page on the Motion Video Surveillance project at:
http://puppylinux.org/wikka/Motion ]
Please find download link for motion-3.2.8.pet at the foot of this message.
This update includes motion detection capturing of avi as well as jpeg images plus considerably more functionality. It has been compiled from the original sources.
I have kept the original information at the bottom of this message, concerning the earlier motion-3.1.19.pet for completeness, but I strongly advise upgrading to the more advanced, but equally easy to use, motion-3.2.8 as soon as possible.
I've just discovered a nice article on setting up Motion and webcams in general by Mark Alexander Bain entitled "CLI Magic: Getting into Motion" at http://www.linux.com/articles/114118
For attitional information you might also want to refer to my recent but rough HOWTO: Manually get your webcam and/or TV card working at: http://www.murga-linux.com/puppy/viewtopic.php?t=21464
For an alternative, sophisticated video surveillance solution, which uses the "zoneminder" video surveillance package (from http:://www.zoneminder.com), you might like to try the Puppy Watchdog distribution available via: http://puppylinux.org/wikka/WatchDog
--------------------------------------------------------------
motion-3.2.8 compile notes and dotpet mini-howto:
[Compiled and created on Puppy Linux 2.17.1 with devx_217.sfs loaded, and then packaged as a dotpet using dir2pet].
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/Mo ... llOverview
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.
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/moti ... z?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/Mo ... gItRunning
[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/viewto ... ch&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 <that process id>
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!
_____________________________________________
Original thread message concerning motion version 3.1.19 follows:
The following is the contents of the attached readme.txt for the package:
--------------
motion-3.1.19 Video Surveillance Tool
Packaged for puppy linux by: William McEwan (puppy linux member mcewanw). Revision 1, 05sep2007
Home Webpage for Motion: http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome
This puppy linux pet is was produced from the original Damn Small Linux compilation found at: http://distro.ibiblio.org/pub/linux/dis ... ion.tar.gz dated: 04/14/2005
[Thanks are due newOldUser of the DSL community. The application looks for its config file motion.conf in /home/knoppix or in ~/.motion so perhaps the source originally comes from the knoppix distribution?]
For ease of future upgrade, I have tried to keep the directory structure of my installation pet for motion as close to the original DSL installation as possible.
This is a simple compilation of motion which, for ease of installation, has been stripped of mysql and ffmpeg operability.
However, there is nothing to stop a more complex compilation, with more facility, being successful on puppy linux.
-------------
Some Details:
I extracted motion.tar.gz into a single directory motion-3.1.19
I then created the directory motion-3.1.19/root/,motion and moved motion.conf from motion-3.1.19/home/dsl into there so that the application motion would be able to find motion.conf post-installation.
I then used dir2pet to produce the puppy linux pet archive motion-3.1.19.pet.
I have arranged for the installation to add a mini-eye.xpm icon and Motion-3.1.19 Video Surveillance entry to the main JWM menu under Multimedia. To make it easier to stop motion running when desired, I use the main menu to start motion via a simple shell script, /root/.motion/motion.sh which opens a controlling rxvt console. The advantage of that method is that it makes it easy to stop motion running when desired by clicking on the console and pressing Ctrl-C. The user can also more easily finetune the start-up procedure, if they wish, by editing motion.sh
This motion-3.1.19.pet archive stores the following files and directories on your system:
/root/.motion/
/root/.motion/readme.txt [this file]
/root/.motion/motion.conf [the application's configuration file (text)]
/root/.motion/motion.sh [a simple shell script which can be used to start motion in a controlling rxtv shell]
/opt/motion/motion [the main application]
/home/dsl/
/home/dsl/motion/
/home/dsl/motion/pics/ [the default location where the captured jpeg images are stored]
/home/dsl/motionScript [?]
/home/dsl/motionTiming.log [?]
/usr/share/applications/motion.desktop
--------------
Before running motion make sure your webcam is setup and working correctly. Unless you have already arranged that, you may first need to: depmod -a; modprobe videodev; modprobe <your_webcam_driver_module>
This pet does not include any webcam driver modules, you must find the approprate one for your webcam and install that yourself. You may find some useful information related to that in a howto I have written (HOWTO: Manually get your webcam and/or TV card working) and posted to the puppy murga-linux forum at:
http://www.murga-linux.com/puppy/viewtopic.php?t=21464
To run motion, either:
* click on JWM menu > Multimedia > Motion-3.1.19 Video Surveillance or
* open an rxvt or any commandline window and enter the command: /opt/motion/motion or
* open a file manager window at /root/.motion and single-click on the motion.sh application icon found there or
* open a file manager window at /opt/motion and single-click on the motion application icon found there
The first three of these method have the advantage that you can easily press keys Ctrl-C to stop motion running. Alternatively, you can always use the command top (or ps) to obtain the process id of the running motion application and then enter kill <that process id> to terminate it.
--------------
After installation, motion is initially configured to store the jpeg images it captures in the directory /home/dsl/motion/pics. If you wish them to be stored in a different directory, edit /root/.motion/motion.conf and change the line starting with target_dir to wherever you wish your images to go.
Refer to http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome for detailed information on using motion and for detailed help on understanding and modifying its configuration file motion.conf
-------------
You can download motion-3.x.x.pet from http://dotpups.de/dotpups/Multimedia/Mo ... veillance/
or you can use the links below to download from this forum.
Dotpet for motion-3.2.8 Video Surveillance application
plus mini-howto on its compilation and construction
Author: William McEwan (mcewanw). Revision 1, 10Sept2007
[ Please also refer to the new Puppy Linux Wiki page on the Motion Video Surveillance project at:
http://puppylinux.org/wikka/Motion ]
Please find download link for motion-3.2.8.pet at the foot of this message.
This update includes motion detection capturing of avi as well as jpeg images plus considerably more functionality. It has been compiled from the original sources.
I have kept the original information at the bottom of this message, concerning the earlier motion-3.1.19.pet for completeness, but I strongly advise upgrading to the more advanced, but equally easy to use, motion-3.2.8 as soon as possible.
I've just discovered a nice article on setting up Motion and webcams in general by Mark Alexander Bain entitled "CLI Magic: Getting into Motion" at http://www.linux.com/articles/114118
For attitional information you might also want to refer to my recent but rough HOWTO: Manually get your webcam and/or TV card working at: http://www.murga-linux.com/puppy/viewtopic.php?t=21464
For an alternative, sophisticated video surveillance solution, which uses the "zoneminder" video surveillance package (from http:://www.zoneminder.com), you might like to try the Puppy Watchdog distribution available via: http://puppylinux.org/wikka/WatchDog
--------------------------------------------------------------
motion-3.2.8 compile notes and dotpet mini-howto:
[Compiled and created on Puppy Linux 2.17.1 with devx_217.sfs loaded, and then packaged as a dotpet using dir2pet].
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/Mo ... llOverview
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.
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/moti ... z?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/Mo ... gItRunning
[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/viewto ... ch&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 <that process id>
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!
_____________________________________________
Original thread message concerning motion version 3.1.19 follows:
The following is the contents of the attached readme.txt for the package:
--------------
motion-3.1.19 Video Surveillance Tool
Packaged for puppy linux by: William McEwan (puppy linux member mcewanw). Revision 1, 05sep2007
Home Webpage for Motion: http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome
This puppy linux pet is was produced from the original Damn Small Linux compilation found at: http://distro.ibiblio.org/pub/linux/dis ... ion.tar.gz dated: 04/14/2005
[Thanks are due newOldUser of the DSL community. The application looks for its config file motion.conf in /home/knoppix or in ~/.motion so perhaps the source originally comes from the knoppix distribution?]
For ease of future upgrade, I have tried to keep the directory structure of my installation pet for motion as close to the original DSL installation as possible.
This is a simple compilation of motion which, for ease of installation, has been stripped of mysql and ffmpeg operability.
However, there is nothing to stop a more complex compilation, with more facility, being successful on puppy linux.
-------------
Some Details:
I extracted motion.tar.gz into a single directory motion-3.1.19
I then created the directory motion-3.1.19/root/,motion and moved motion.conf from motion-3.1.19/home/dsl into there so that the application motion would be able to find motion.conf post-installation.
I then used dir2pet to produce the puppy linux pet archive motion-3.1.19.pet.
I have arranged for the installation to add a mini-eye.xpm icon and Motion-3.1.19 Video Surveillance entry to the main JWM menu under Multimedia. To make it easier to stop motion running when desired, I use the main menu to start motion via a simple shell script, /root/.motion/motion.sh which opens a controlling rxvt console. The advantage of that method is that it makes it easy to stop motion running when desired by clicking on the console and pressing Ctrl-C. The user can also more easily finetune the start-up procedure, if they wish, by editing motion.sh
This motion-3.1.19.pet archive stores the following files and directories on your system:
/root/.motion/
/root/.motion/readme.txt [this file]
/root/.motion/motion.conf [the application's configuration file (text)]
/root/.motion/motion.sh [a simple shell script which can be used to start motion in a controlling rxtv shell]
/opt/motion/motion [the main application]
/home/dsl/
/home/dsl/motion/
/home/dsl/motion/pics/ [the default location where the captured jpeg images are stored]
/home/dsl/motionScript [?]
/home/dsl/motionTiming.log [?]
/usr/share/applications/motion.desktop
--------------
Before running motion make sure your webcam is setup and working correctly. Unless you have already arranged that, you may first need to: depmod -a; modprobe videodev; modprobe <your_webcam_driver_module>
This pet does not include any webcam driver modules, you must find the approprate one for your webcam and install that yourself. You may find some useful information related to that in a howto I have written (HOWTO: Manually get your webcam and/or TV card working) and posted to the puppy murga-linux forum at:
http://www.murga-linux.com/puppy/viewtopic.php?t=21464
To run motion, either:
* click on JWM menu > Multimedia > Motion-3.1.19 Video Surveillance or
* open an rxvt or any commandline window and enter the command: /opt/motion/motion or
* open a file manager window at /root/.motion and single-click on the motion.sh application icon found there or
* open a file manager window at /opt/motion and single-click on the motion application icon found there
The first three of these method have the advantage that you can easily press keys Ctrl-C to stop motion running. Alternatively, you can always use the command top (or ps) to obtain the process id of the running motion application and then enter kill <that process id> to terminate it.
--------------
After installation, motion is initially configured to store the jpeg images it captures in the directory /home/dsl/motion/pics. If you wish them to be stored in a different directory, edit /root/.motion/motion.conf and change the line starting with target_dir to wherever you wish your images to go.
Refer to http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome for detailed information on using motion and for detailed help on understanding and modifying its configuration file motion.conf
-------------
You can download motion-3.x.x.pet from http://dotpups.de/dotpups/Multimedia/Mo ... veillance/
or you can use the links below to download from this forum.