Motion Linux is a highly configurable easy to use cctv software. The CCTV system that is explained here is based on 3 cheap cameras. 2 web cams and one Chines Yoosee IP Camera (wifi) The Motion linux in the Ubuntu software is not the latest version .Therefore it is advisable to get the software from the Motion website First install Motion Linux latest release using the GDebi Package Installer . Now if you see the folder motion is being created at /etc/motion/. You can see 5 files in this folder as i the following figure Out of the 5 files shown in the above figure ,the main file is motion.conf Other 4 files are the configuration files of linked cameras If you open the motion.conf file you can see the commands of linking camera are placed at the bottom as follows (728-731). sudo gedit /etc/motion/motion.conf There was an error in the names of camera files in the default installation in the lines 728 to 731. Therefore you will have to correct and save the file as in the above picture. You will have to delete ” ; ” placed at the beginning of the commands in order to activate the corresponding camera .You can see it in 728,729,and 730. Now the corresponding configure files of cameras are edited as follows. Usb camera 1 sudo gedit /etc/motion/camera1-dist.conf Then save the file Usb camera 2 sudo gedit /etc/motion/camera2-dist.conf Then save the file IP Camera sudo gedit /etc/motion/camera3-dist.conf For the netcam_url you will have to enter your camera’s url . To see how to get your url using xeoma please refer this blog here I have created a target directory for videos generated when a motion is detected in my Video directory under the home directory as shown in the above .You can make your directory for videos as your wish .But you have to correctly mentioned path in the configure files. Now you can see the 3 cameras operating in the following figure when you open the Ubuntu terminal and enter the following command to start Motion sudo /usr/bin/motion Then open the web browser and enter the url http://localhost:8080/ In the web panel itself there are facilities provided to start ,restart , stop motion program. The stopping or resuming motion detection also can be done using the web panel . How to add a startup icon for start Motion Please use the Mainmenu program to add an icon as in the following figure How to upload motion detection videos instantaneously to dropbox cloud using dropbox sync in order to view remotely Make a symlink of the folder of motion detection videos and copy it to the dropbox sync directory in the home page as follows sudo ln -s /home/bkjaya1952/Videos/bkj /home/bkjaya1952/ Now you can copy the symlink folder to the dropbox sync folder You can see the videos are being uploaded to the dropbox cloud in the above figure How make alarm sounds when a motion is detected First store a alarm sound clip in a folder of your PC Install mplayer software using the Ubuntu software center In my case My-recording-1.wav.wav file has been saved in /home/bkjaya1952/Music Open the terminal and enter sudo gedit /etc/motion/camera2-dist.conf Please enter the following line as shown in the above figure and save the file. on_motion_detected mplayer /home/bkjaya1952/Music/My-recording-1.wav.wav and save the file Now you can hear an alarm sound when a motion is detected by the camera 1 How to record the sound using the camera microphone when a motion is detected The program “arecord” needs to be installed on your system and you need a full working “motion” installation on your system. Following example shows how to record sound using the camera 2 Open the terminal and enter sudo gedit /etc/motion/camera2-dist.conf Then the camera2-dist.conf Edit the file as shown in the figure below Please see the command line no 10 on_event_start arecord -d 60 -f cd /home/bkjaya1952/Videos/bkj/c4/%v-%Y%m%d%H%M%S.mp3 Here the duration of the recording is limited to 60 seconds (-d 60) in my case as the maximum duration of a motion detection of an alarm event in the main file (motion.conf) is limited to 60 seconds. In my case the recorded sound file is saved at the directory of /home/bkjaya1952/Videos/bkj/c4/ Motion linux is a very useful software in making cctv systems. We must be thankful to the developers of Motion Lunux for providing us a great cctv software free of charge
5 Comments
john
1/15/2019 03:23:03 pm
hi. i did follow your guide to set my motion detection in Raspberry PI and i failed to see the second camera. I have motion working working with the onboard camera and i added a usb camera (Microsoft lifecam HD3000) and it is recongised from the system since i can manually see with the software fswebcam.
Reply
1/20/2019 04:47:16 pm
Hi John
Reply
Sohaib Akram
11/14/2020 12:00:17 pm
Great
B.K.Jayasundera
1/20/2019 06:03:57 pm
Hi John
Reply
1/21/2019 10:38:30 am
Hi John Leave a Reply. |
AuthorRetired Director of Irrigation ,Sri Lanka Categories
All
Archives
March 2020
|