Install "motion" using the following command:
sudo apt-get install motion
The output might be as follows:
[...]
Lege Gruppe »motion« (GID 1020) an ...
Fertig.
Lege Systembenutzer »motion« (UID 107) an ...
Lege neuen Benutzer »motion« (UID 107) mit Gruppe »motion« an ...
Erstelle Home-Verzeichnis »/home/motion« nicht.
Füge Benutzer »motion« der Gruppe »video« hinzu ...
Benutzer motion wird zur Gruppe video hinzugefügt.
Fertig.
insserv: warning: script 'codserver' missing LSB tags and overrides
Not starting motion daemon, disabled via /etc/default/motion ... (warning)
(eg. the user "motion" was added)
Make some preparations:
mkdir /home/motion
chown motion:motion /home/motion
Edit the file "/etc/motion/motion.conf". The most important options are:
daemon on
webcam_localhost off
; videodevice /dev/video0
width 640
height 480
netcam_url http://192.168.20.30/IMAGE.JPG?cidx=1714589724
netcam_userpass USER:PASSWD
# Motion Detection Settings
threshold 6000
target_dir /home/motion
; on_event_start value
; on_event_end value
threshold: Amount of pixels that have to be changed in order that motion is detected
target_dir: folder where motion events are stored
on_event_start / on_event_end: Commands to execute on motion events
Finally enable the motion daemon in: /etc/default/motion