How to use Motion Linux ( with 2 web cams & Chinese IP camera on Ubuntu 17.10 (Artful Aardvark)

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)

Please refer the following site for latest details

Motion Linux ( with 2 web cams & Chinese IP camera on Ubuntu



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 .

Screenshot from 2018-02-02 18-27-09

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

Screenshot from 2018-02-02 18-28-44

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


Screenshot from 2018-02-02 16-51-03

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

Screenshot from 2018-02-02 12-55-58

Then save the file

Usb camera 2

sudo gedit /etc/motion/camera2-dist.conf

Screenshot from 2018-02-02 12-57-48

Then save the file

IP Camera

sudo gedit /etc/motion/camera3-dist.conf

Screenshot from 2018-02-02 12-57-03

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



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 floder


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

Screenshot from 2018-02-03 09-31-32

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

Screenshot from 2018-02-03 17-59-56

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