{"id":1920,"date":"2025-07-22T00:28:00","date_gmt":"2025-07-21T22:28:00","guid":{"rendered":"https:\/\/christeninformatica.ch\/?p=1920"},"modified":"2025-08-26T22:13:53","modified_gmt":"2025-08-26T20:13:53","slug":"motion-detection-audio-surveillance-linux-diy-usb-webcam-configuration-installation-alarm","status":"publish","type":"post","link":"https:\/\/christeninformatica.ch\/it\/motion-detection-audio-surveillance-linux-diy-usb-webcam-configuration-installation-alarm\/","title":{"rendered":"DIY Motion Detection Surveillance System With Audio and Alarm"},"content":{"rendered":"<h2>How to Install and Configure Motion on Your Linux Server<\/h2>\n\n<h3>Introduction<\/h3>\n\n<p>In this tutorial I will show you how to turn a computer -or a server- into a surveillance system. In this example I will use USB cameras (no wireless all wired). Topics like <b>motion detection with audio<\/b>, alarm and using multiple cameras will be covered in this tutorial. <\/p>\n\n<h3>Prerequisites<\/h3>\n\n<ul class=\"wp-block-list\">\n<li>A computer -or server- running Linux with at least (minimum requisites) an i7 9th generation processor, 2-3 USB3 controllers and 16 GB RAM<\/li>\n<li>4 USB Webcams and USB3 extension cables<\/li>\n<\/ul>\n\n<h3>Motion Installation<\/h3>\n<h4>Install Motion Opensuse Leap Linux<\/h4>\n\n<div class=\"comandi\">\n<blockquote><pre>\n&#35; zypper in motion\n<\/pre><\/blockquote>\n<\/div>\n\n<h4>Istall Motion on Ubuntu Linux<\/h4>\n\n<div class=\"comandi\">\n<blockquote><pre>\n$ sudo apt update\n$ sudo apt install motion\n<\/pre><\/blockquote>\n<\/div>\n\n<h3 class=\"wp-block-heading\">Motion Configuration<\/h3>\n\n<p>You can configure motion using configuration files, the file moton.conf should be located at \/etc\/motion\/motion.conf but I highly suggest that you use a normal user to run motion. So, you can create \u201c.motion\u201d in the home directory and copy the motion.conf file in that directory this way:<\/p>\n<div class=\"comandi\">\n<blockquote>\n<pre>\n# pwd\n\/home\/user\n# md .motion\n# cp \/etc\/motion\/motion.conf .motion\/\n# chown -R user:motion .motion\n# exit\n<\/pre>\n<\/blockquote>\n<\/div>\n\n<p>Once copied the file you can configure the motion server, here is my configuration file for this specific case:<\/p>\n\n<div class=\"comandi\">\n<blockquote>\n<pre>\n############################################################\n# System control configuration parameters\n############################################################\n# Start in daemon (background) mode and release terminal.\ndaemon on\n# Start in Setup-Mode, daemon disabled.\nsetup_mode off\n# File to write logs messages into.  If not defined stderr and syslog is used.\n# log_file\n# Level of log messages [1..9] (EMG, ALR, CRT, ERR, WRN, NTC, INF, DBG, ALL).\nlog_level 6\n# Target directory for pictures, snapshots and movies\ntarget_dir \/data\/motion-media\n############################################################\n# Image Processing configuration parameters\n############################################################\n# Image width in pixels.\n#width 640\n# Image height in pixels.\n#height 480\n# Maximum number of frames to be captured per second.\nframerate 15\n# Text to be overlayed in the lower left corner of images\ntext_left CAMERA1\n# Text to be overlayed in the lower right corner of images.\ntext_right %Y-%m-%d\\n%T-%q\n############################################################\n# Motion detection configuration parameters\n############################################################\n# Always save pictures and movies even if there was no motion.\nemulate_motion off\n# Threshold for number of changed pixels that triggers motion.\nthreshold 2000\n# Noise threshold for the motion detection.\n#noise_level 32\n# Number of images that must contain motion to trigger an event.\nminimum_motion_frames 1\n# Gap in seconds of no motion detected that triggers the end of an event.\nevent_gap 60\n# The number of pre-captured (buffered) pictures from before motion.\npre_capture 1\n# Number of frames to capture after motion is no longer detected.\npost_capture 25\n############################################################\n# Script execution configuration parameters\n############################################################\n# Command to be executed when an event starts.\n; on_event_start value\n# Command to be executed when an event ends.\n; on_event_end value\n# Command to be executed when a movie file is closed.\n; on_movie_end value\n############################################################\n# Picture output configuration parameters\n############################################################\n# Output pictures when motion is detected\npicture_output off\n# File name(without extension) for pictures relative to target directory\npicture_filename %Y%m%d%H%M%S-%q\n############################################################\n# Movie output configuration parameters\n############################################################\n# Create movies of motion events.\nmovie_output on\n# Maximum length of movie in seconds.\nmovie_max_time 300\n# The encoding quality of the movie. (0=use bitrate. 1=worst quality, 100=best)\nmovie_quality 80\n# Container\/Codec to used for the movie. See motion_guide.html\nmovie_codec mp4\n# File name(without extension) for movies relative to target directory\nmovie_filename %m-%d-%Y_%H:%M:%S\n############################################################\n# Webcontrol configuration parameters\n############################################################\n# Port number used for the webcontrol.\nwebcontrol_port 8080\n# Restrict webcontrol connections to the localhost.\nwebcontrol_localhost off\n# Type of configuration options to allow via the webcontrol.\nwebcontrol_parms 0\n# Self-signed certificate\n#webcontrol_tls on\n#webcontrol_cert \/etc\/motion\/ssl\/motion.crt\n#webcontrol_key \/etc\/motion\/ssl\/motion.key\n############################################################\n# Live stream configuration parameters\n############################################################\nstream_port 8081\nstream_localhost off\nstream_tls on\n##############################################################\n# Camera config files - One for each camera.\n##############################################################\ncamera \/etc\/motion\/config\/camera1.conf\ncamera \/etc\/motion\/config\/camera2.conf\ncamera \/etc\/motion\/config\/camera3.conf\ncamera \/etc\/motion\/config\/camera4.conf\n<\/pre>\n<\/blockquote>\n<\/div>\n<p>The only important parameters in the main motion.conf configuration file is setting daemon to on and the cameras configuration files, the rest of the configuration will be in separate configuration files, one for each camera. The Self-signed certificate part will be covered in the security part of this tutorial.<\/p>\n\n<p>If you use <b>multiple camera<\/b> with motion you should create a configuration file for each one of them. <\/p>\n\n<h3>Using multiple webcams with motion detection<\/h3>\n\n<p>In this example I will create 4 files in the \/etc\/motion\/ directory, camera1.conf, camera2.conf, camera3.conf and camera4.conf.<\/p>\n\n<p>Camera1 will also be used to do live streams and has motion detection with audio. Camera2 is used to do surveillance. Camera3 is in the server room, has bad quality and triggers an alarm when motion is detected at the entrance. Camera4 is the same as camera3 but is used to monitor the main entrance.<\/p>\n\n<p>If you work with more than one camera I suggest you to use different ones, not the exact same model so you can work with device by-id.<\/p>\n\n<p>To create the configuration files you need a list of the webcams.\nRun the following command: v4l2-ctl &#8211;list-devices.<\/p>\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"755\" src=\"https:\/\/christeninformatica.ch\/media\/list-devices-motion-detection-surveillance-webcam-usb-guide.jpg\" alt=\"\" class=\"wp-image-1924\" srcset=\"https:\/\/christeninformatica.ch\/media\/list-devices-motion-detection-surveillance-webcam-usb-guide.jpg 1024w, https:\/\/christeninformatica.ch\/media\/list-devices-motion-detection-surveillance-webcam-usb-guide-300x221.jpg 300w, https:\/\/christeninformatica.ch\/media\/list-devices-motion-detection-surveillance-webcam-usb-guide-768x566.jpg 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n<p>If you work with device by-id you can run the following command:<\/p>\n\n<div class=\"comandi\">\n<blockquote>\n<pre>\nuser@SERVER3:~> ls \/dev\/v4l\/by-id\nusb-046d_Brio_105_2443ZBQ5QCB8-video-index0\nusb-046d_Brio_105_2443ZBQ5QCB8-video-index1\nusb-bx_ic_NGS_XPRESSCAM300-video-index0\nusb-bx_ic_NGS_XPRESSCAM300-video-index1\nusb-SHENZHEN_AONI_ELECTRONIC_CO.__LTD_Full_HD_webcam_AN202011030002-video-index0\nusb-SHENZHEN_AONI_ELECTRONIC_CO.__LTD_Full_HD_webcam_AN202011030002-video-index1\nuser@SERVER3:~>\n<\/pre>\n<\/blockquote>\n<\/div>\n<p>To be sure to do a proper configuration of the cameras you should check the supported resolutions with the v4l2-ctl command.<\/p>\n\n<div class=\"comandi\">\n<blockquote>\n<pre>\nuser@SERVER3:~> v4l2-ctl --list-formats-ext --device \/dev\/video0\nioctl: VIDIOC_ENUM_FMT\n        Index       : 0\n        Type        : Video Capture\n        Pixel Format: 'YUYV'\n        Name        : YUYV 4:2:2\n                Size: Discrete 640x480\n                        Interval: Discrete 0.033s (30.000 fps)\n                        Interval: Discrete 0.200s (5.000 fps)\n\nuser@SERVER3:~>\n<\/pre>\n<\/blockquote>\n<\/div>\n<p>\nThis is the output for the low quality cameras, camera3 and camera4 that will be only used for motion detection so I will set them to 640&#215;480 with 5 fps.<\/p>\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"496\" src=\"https:\/\/christeninformatica.ch\/media\/motion-detection-surveillance-webcam-guide-analyzing-cam3.jpg\" alt=\"\" class=\"wp-image-1923\" srcset=\"https:\/\/christeninformatica.ch\/media\/motion-detection-surveillance-webcam-guide-analyzing-cam3.jpg 1024w, https:\/\/christeninformatica.ch\/media\/motion-detection-surveillance-webcam-guide-analyzing-cam3-300x145.jpg 300w, https:\/\/christeninformatica.ch\/media\/motion-detection-surveillance-webcam-guide-analyzing-cam3-768x372.jpg 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n<p>Here are the configuration files of the cameras for you to analyze or eventually replicate:<\/p>\n<h3>Motion Camera1<\/h3>\n<div class=\"comandi\">\n<blockquote>\n<pre>\ncamera_name CAM-1\ncamera_id 001\nvideo_device \/dev\/v4l\/by-id\/usb-046d_Brio_105_2443ZBQ5QCB8-video-index0\ntext_left CAM-1\nwidth = 1920\nheight = 1080\nstream_port 8082\nstream_maxrate = 30\nmovie_quality 100\nmovie_max_time 1200\nemulate_motion on\ntarget_dir \/data\/motion-media\/camera1\non_movie_start \/bin\/bash \/etc\/motion\/config\/motionaudio.sh start %m-%d-%Y_%H:%M:%S\non_movie_end \/bin\/bash \/etc\/motion\/config\/motionaudio.sh stop %m-%d-%Y_%H:%M:%S\n<\/pre>\n<\/blockquote>\n<\/div>\n<p>I will not explain self-explanatory things, special to this camera is the use of the motionaudio.sh script, that allows you to have motion detection with audio. The other parameters are movie_max_time which is set to 1200 and emulate_motion which is set to on. With this configuration camera1 will record all the time and make videos with audio every 20 minutes.<\/p>\n\n<h4>Motion Detection With Audio<\/h4>\nTo add the motion detection with audio functionality you have to create a script, say, \/etc\/motion\/config\/motionaudio.sh and add these two lines in the configuration file of the camera: \n\n<div class=\"comandi\">\n<blockquote>\n<pre>\non_movie_start \/bin\/bash \/etc\/motion\/config\/motionaudio.sh start %m-%d-%Y_%H:%M:%S\non_movie_end \/bin\/bash \/etc\/motion\/config\/motionaudio.sh stop %m-%d-%Y_%H:%M:%S\n<\/pre>\n<\/blockquote>\n<\/div>\n\nTo create the script you can use vi and then you have to make it executable:\n\n<div class=\"comandi\">\n<blockquote>\n<pre>\n# vi \/etc\/motion\/config\/motionaudio.sh\n# chmod u+x \/etc\/motion\/config\/motionaudio.sh\n<\/pre>\n<\/blockquote>\n<\/div>\nNow you can add the following code in the file you created:\n<div class=\"comandi\">\n<blockquote>\n<pre>\n#!\/bin\/bash\nmoviedir=\/data\/motion-media\/camera1 # change this\naction=$1\naudio=$2\naext=mp3 # change if you prefer a different audio format or extension\nvext=mp4 # change this to what is specified in the motion.conf file for the line ffmpeg_video_codec\nvoutext=mkv #change this to the video file that will be created by joining the audio and video files\n\nfunction startaudio () {\n  if pgrep -f \"arecord\"; then sudo pkill -9 -f \"arecord -f cd -r 22050 -D plughw:2,0\"; fi\n  arecord -f cd -r 22050 -D plughw:2,0 \"${moviedir}\/${audio}.${aext}\" &\n  audiopid=${BASHPID}\n  echo \"${audiopid}\" > \"${moviedir}\/${audio}.pid\"\n}\n\nfunction stopaudio () {\n  audiopids=$(find ${moviedir} -type f -iname \"*.pid\" -printf \"%f\\n\" | cut -d. -f1)\n  while read -r x; do\n          if pgrep -F \"${x}.pid\"; then sudo pkill -9 -F \"${x}.pid\"; fi\n          if [[ -f \"${moviedir}\/${x}.${vext}\" ]] && [[ -f \"${moviedir}\/${x}.${aext}\" ]]; then\n          ffmpeg -y -i \"${moviedir}\/${x}.${vext}\" -i \"${moviedir}\/${x}.${aext}\" -c:v copy -c:a copy \"${moviedir}\/${x}.${voutext}\" &&  rm -f \"${moviedir}\/${x}\".{$aext,$vext,pid}\n          fi\n  done <<< \"${audiopids}\"\n  if ! pgrep -f \"sudo nohup motion\"; then sudo pkill -9 -f \"arecord -f cd -r 22050 -D plughw:2,0\"; fi\n}\n\ncase ${action,,} in\nstop ) stopaudio ;;\nstart ) startaudio ;;\nesac\n<\/pre>\n<\/blockquote>\n<\/div>\n<h3>Motion Camera2<\/h3>\n<div class=\"comandi\">\n<blockquote>\n<pre>\ncamera_name CAM-2\ncamera_id 002\nvideo_device \/dev\/v4l\/by-id\/usb-SHENZHEN_AONI_ELECTRONIC_CO.__LTD_Full_HD_webcam_AN202011030002-video-index0\ntext_left CAM-2\nstream_localhost off\nwidth = 1920\nheight = 1080\nstream_port 8083\nstream_maxrate = 15\nmovie_quality = 90\ntarget_dir \/data\/motion-media\/camera2\n<\/pre>\n<\/blockquote>\n<\/div>\n\n<h4 class=\"wp-block-heading\">Motion Camera3<\/h4>\n\n<div class=\"comandi\">\n<blockquote>\n<pre>\ncamera_name CAM-3\ncamera_id 003\nvideo_device \/dev\/v4l\/by-id\/usb-bx_ic_NGS_XPRESSCAM300-video-index0\ntext_left CAM-3\nstream_localhost off\nwidth = 640\nheight = 480\nstream_port 8084\nstream_maxrate = 5\nmovie_quality = 90\ntarget_dir \/data\/motion-media\/camera3\non_event_start \/bin\/bash \/etc\/motion\/config\/alarm.sh\n<\/pre>\n<\/blockquote>\n<\/div>\n<p>Camera3 is configured to trigger an alarm when motion is detected.<\/p>\n<div class=\"comandi\">\n<blockquote>\n<pre>\n# vi \/etc\/motion\/config\/alarm.sh\n# chmod u+x \/etc\/motion\/config\/alarm.sh\n<\/pre>\n<\/blockquote>\n<\/div>\n<p><\/p>\n<div class=\"comandi\">\n<blockquote>\n<pre>\n#!\/bin\/bash\nplay \/etc\/motion\/audio\/security-alarm.mp3\n<\/pre>\n<\/blockquote>\n<\/div>\n<h4 class=\"wp-block-heading\">Motion Camera4<\/h4>\n\n<div class=\"comandi\">\n<blockquote>\n<pre>\ncamera_name CAM-4\ncamera_id 004\nvideo_device \/dev\/video4\ntext_left CAM-4\nstream_localhost off\nwidth = 640\nheight = 480\nstream_port 8085\nstream_maxrate = 5\nmovie_quality = 90\ntarget_dir \/data\/motion-media\/camera4\non_event_start \/bin\/bash \/etc\/motion\/config\/alarm.sh\n<\/pre>\n<\/blockquote>\n<\/div>\n\n<h2 class=\"wp-block-heading\">Performance Using USB Webcams With Motion<\/h2>\n\n<p>In this example using USB cameras you should take in mind this: <\/p>\n\n<p>\u201cUSB cameras take a lot of bandwidth. A USB camera connected to a USB port or hub consumes virtually all the bandwidth that the port can handle. Even with a small framesize and low framerate you should not expect to have more than one camera per USB controller. If you need more than one USB camera it is possible to add extra USB PCI cards to your computer. It is also possible that your computer has more than one controller for different USB slots. For example, if the computer has six USB ports, the three on the left may be on controller A versus the three on the right may be on controller B.\u201d<\/p>\n\n<p>USB 3.0 devices enable improved image quality with less \"pixelation\" and latency when streaming and recording in HD or 4K therefore it is recommended for professional streaming or recording.<\/p>\n\n<p>For this example with 4 webcams I added a USB3 controller, then I used the two other ones integrated in the motherboard.<\/p> And, of course, you should use USB3 extension cables.<\/p>\n\nYou can use usbtop to monitor the USB webcam bandwidth usage: \n<div class=\"comandi\">\n<blockquote>\n<pre>\nuser@SERVER3:~> sudo usbtop\n<\/pre>\n<\/blockquote>\n<\/div>\n<p><\/p>\n<img decoding=\"async\" src=\"https:\/\/christeninformatica.ch\/media\/guide-motion-detection-webcam-usb-usbtop.jpg\" alt=\"Motion Detection Webcams Bandwidth\"\/>\n<p><\/p>\n<p>You can check the performance of the motion server with the htop command.<\/p>\n<img decoding=\"async\" src=\"https:\/\/christeninformatica.ch\/media\/guide-motion-detection-server-htop-performance.jpg\" alt=\"Motion Detection Performance Htop\"\/>\n\n<h2 class=\"wp-block-heading\">Testing Motion Detection<\/h2>\n<p>To start and stop motion you can use the following commands:<\/p>\n<div class=\"comandi\">\n<blockquote><pre>\nuser@SERVER3:~> motion\n[0:motion] [NTC] [ALL] conf_load: Processing thread 0 - config file \/home\/user\/.motion\/motion.conf\n[0:motion] [NTC] [ALL] config_camera: Processing camera config file \/etc\/motion\/config\/camera1.conf\n[0:motion] [NTC] [ALL] config_camera: Processing camera config file \/etc\/motion\/config\/camera2.conf\n[0:motion] [NTC] [ALL] config_camera: Processing camera config file \/etc\/motion\/config\/camera3.conf\n[0:motion] [NTC] [ALL] config_camera: Processing camera config file \/etc\/motion\/config\/camera4.conf\n[0:motion] [NTC] [ALL] motion_startup: Logging to syslog\n[0:motion] [NTC] [ALL] motion_startup: Motion 4.5.1 Started\n[0:motion] [NTC] [ALL] motion_startup: Using default log type (ALL)\n[0:motion] [NTC] [ALL] motion_startup: Using log type (ALL) log level (NTC)\n[0:motion] [NTC] [ALL] become_daemon: Motion going to daemon mode\nuser@SERVER3:~> killall -9 motion\n<\/pre><\/blockquote>\n<\/div>\n\n<p>Once you are done with the configuration you can start motion and access the UI of motion by tipping the address of the server with the port 8080. For example: http:\/\/10.1.2.5:8080.<\/p>\n\n<p>A web interface will appear in which you can see all the cameras at one time, start events and actions...<\/p>\n<img decoding=\"async\" src=\"https:\/\/christeninformatica.ch\/media\/guide-motion-detection-audio-alarm-4-cameras-surveillance.jpg\" alt=\"Motion Detection with audio and 4 Cameras\"\/>\n\n<h2 class=\"wp-block-heading\">Motion Server Security and Securing the application<\/h2>\n\n<p>More details on security issues will be published in the second part of this tutorial, for now I want to share with you some good practices, especially if your goal is to create a simple internal surveillance system.<\/p>\n\n<p>If you install the motion surveillance system local on your computer and you don\u2019t want people to have access to it from other hosts (just locally), set stream_localhost to on. <\/p>\n\n<p>If you use a script or a command that requires root privileges you should use sudo. To edit the \/etc\/sudoers file you can run visudo as root.<\/p>\n<div class=\"comandi\">\n<blockquote><pre>\nroot ALL=(ALL:ALL) ALL\nuser ALL=(ALL:ALL) NOPASSWD: \/usr\/bin\/nohup, \/bin\/pkill, \/bin\/mount, \/bin\/umount\n<\/pre><\/blockquote>\n<\/div>\n\n<p>If you want to secure the connection for internal use in your LAN you can create a self-signed certificate. To do that you have to create a self-signed certificate and use the web_control parameters in the configuration file of motion to enable it.<\/p>\n\n<h3 class=\"wp-block-heading\">How to create a self-signed certificate for motion<\/h3>\n<div class=\"comandi\">\n<blockquote><pre>\n# openssl genrsa -des3 -out privkey.pem 2048\n# openssl req -new -key privkey.pem -out cert.csr\n# openssl rsa -in privkey.pem -out motion.key\n# openssl x509 -in cert.csr -out motion.crt -req -signkey motion.key -days 800\n<\/pre><\/blockquote>\n<\/div>\n<p><\/p>\n<p>Now, you have to set the webcontrol_tls and stream_tls to on and add the certificate you created.\n<div class=\"comandi\">\n<blockquote><pre>\n# Self-signed certificate\nwebcontrol_tls on\nwebcontrol_cert \/etc\/motion\/ssl\/motion.crt\nwebcontrol_key \/etc\/motion\/ssl\/motion.key\n\n############################################################\n# Live stream configuration parameters\n############################################################\nstream_port 8081\nstream_localhost off\nstream_tls on\n<\/pre><\/blockquote>\n<\/div>\n<p>You can also edit the \/etc\/hosts file of your host and add the following line:<\/p>\n<div class=\"comandi\">\n<blockquote><pre>\n10.1.2.5        motion\n<\/pre><\/blockquote>\n<\/div>\n<p>Once done you can access the UI of motion using https:\/\/motion:8080.<\/p>\n<img decoding=\"async\" src=\"https:\/\/christeninformatica.ch\/media\/guide-motion-detection-audio-surveillance-webcams-https.jpg\" alt=\"Motion Detection With Audio - Self-signed Certificate\"\/>","protected":false},"excerpt":{"rendered":"<p>How to Install and Configure Motion on Your Linux Server Introduction In this tutorial I will show you how to turn a computer -or a server- into a surveillance system. In this example I will use USB cameras (no wireless all wired). Topics like motion detection with audio, alarm and using multiple cameras will be&#8230;<\/p>\n<p class=\"more-link-wrap\"><a href=\"https:\/\/christeninformatica.ch\/it\/motion-detection-audio-surveillance-linux-diy-usb-webcam-configuration-installation-alarm\/\" class=\"more-link\">Read More<span class=\"screen-reader-text\"> &ldquo;DIY Motion Detection Surveillance System With Audio and Alarm&rdquo;<\/span> &raquo;<\/a><\/p>","protected":false},"author":5,"featured_media":1932,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[297],"tags":[328,320,313,331,326,327,329,11],"class_list":["post-1920","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-audio","tag-configuration","tag-installation","tag-linux-guide","tag-motion","tag-motion-detection","tag-surveillance","tag-tutorial"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>DIY Motion Detection Surveillance System With Audio and Alarm &#8226; CHIT<\/title>\n<meta name=\"description\" content=\"Guide on how to install and configure the motion surveillance system with motion detection with audio, alarm and how to use multiple webcams.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/christeninformatica.ch\/it\/motion-detection-audio-surveillance-linux-diy-usb-webcam-configuration-installation-alarm\/\" \/>\n<meta property=\"og:locale\" content=\"it_IT\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"DIY Motion Detection Surveillance System With Audio and Alarm &#8226; CHIT\" \/>\n<meta property=\"og:description\" content=\"Guide on how to install and configure the motion surveillance system with motion detection with audio, alarm and how to use multiple webcams.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/christeninformatica.ch\/it\/motion-detection-audio-surveillance-linux-diy-usb-webcam-configuration-installation-alarm\/\" \/>\n<meta property=\"og:site_name\" content=\"CHIT\" \/>\n<meta property=\"article:published_time\" content=\"2025-07-21T22:28:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-26T20:13:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/christeninformatica.ch\/media\/guide-diy-surveillance-system-with-motion-detection-alarm.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"768\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"chitblog\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"chitblog\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minuti\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/christeninformatica.ch\\\/motion-detection-audio-surveillance-linux-diy-usb-webcam-configuration-installation-alarm\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/christeninformatica.ch\\\/motion-detection-audio-surveillance-linux-diy-usb-webcam-configuration-installation-alarm\\\/\"},\"author\":{\"name\":\"chitblog\",\"@id\":\"https:\\\/\\\/christeninformatica.ch\\\/#\\\/schema\\\/person\\\/b0952e900860b424a6b0906f1d6a0a64\"},\"headline\":\"DIY Motion Detection Surveillance System With Audio and Alarm\",\"datePublished\":\"2025-07-21T22:28:00+00:00\",\"dateModified\":\"2025-08-26T20:13:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/christeninformatica.ch\\\/motion-detection-audio-surveillance-linux-diy-usb-webcam-configuration-installation-alarm\\\/\"},\"wordCount\":1085,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/christeninformatica.ch\\\/motion-detection-audio-surveillance-linux-diy-usb-webcam-configuration-installation-alarm\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/christeninformatica.ch\\\/media\\\/guide-diy-surveillance-system-with-motion-detection-alarm.jpg\",\"keywords\":[\"audio\",\"configuration\",\"installation\",\"Linux guide\",\"motion\",\"motion detection\",\"surveillance\",\"tutorial\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"it-IT\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/christeninformatica.ch\\\/motion-detection-audio-surveillance-linux-diy-usb-webcam-configuration-installation-alarm\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/christeninformatica.ch\\\/motion-detection-audio-surveillance-linux-diy-usb-webcam-configuration-installation-alarm\\\/\",\"url\":\"https:\\\/\\\/christeninformatica.ch\\\/motion-detection-audio-surveillance-linux-diy-usb-webcam-configuration-installation-alarm\\\/\",\"name\":\"DIY Motion Detection Surveillance System With Audio and Alarm &#8226; CHIT\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/christeninformatica.ch\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/christeninformatica.ch\\\/motion-detection-audio-surveillance-linux-diy-usb-webcam-configuration-installation-alarm\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/christeninformatica.ch\\\/motion-detection-audio-surveillance-linux-diy-usb-webcam-configuration-installation-alarm\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/christeninformatica.ch\\\/media\\\/guide-diy-surveillance-system-with-motion-detection-alarm.jpg\",\"datePublished\":\"2025-07-21T22:28:00+00:00\",\"dateModified\":\"2025-08-26T20:13:53+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/christeninformatica.ch\\\/#\\\/schema\\\/person\\\/b0952e900860b424a6b0906f1d6a0a64\"},\"description\":\"Guide on how to install and configure the motion surveillance system with motion detection with audio, alarm and how to use multiple webcams.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/christeninformatica.ch\\\/motion-detection-audio-surveillance-linux-diy-usb-webcam-configuration-installation-alarm\\\/#breadcrumb\"},\"inLanguage\":\"it-IT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/christeninformatica.ch\\\/motion-detection-audio-surveillance-linux-diy-usb-webcam-configuration-installation-alarm\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"it-IT\",\"@id\":\"https:\\\/\\\/christeninformatica.ch\\\/motion-detection-audio-surveillance-linux-diy-usb-webcam-configuration-installation-alarm\\\/#primaryimage\",\"url\":\"https:\\\/\\\/christeninformatica.ch\\\/media\\\/guide-diy-surveillance-system-with-motion-detection-alarm.jpg\",\"contentUrl\":\"https:\\\/\\\/christeninformatica.ch\\\/media\\\/guide-diy-surveillance-system-with-motion-detection-alarm.jpg\",\"width\":1024,\"height\":768},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/christeninformatica.ch\\\/motion-detection-audio-surveillance-linux-diy-usb-webcam-configuration-installation-alarm\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/christeninformatica.ch\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"DIY Motion Detection Surveillance System With Audio and Alarm\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/christeninformatica.ch\\\/#website\",\"url\":\"https:\\\/\\\/christeninformatica.ch\\\/\",\"name\":\"CHIT\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/christeninformatica.ch\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"it-IT\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/christeninformatica.ch\\\/#\\\/schema\\\/person\\\/b0952e900860b424a6b0906f1d6a0a64\",\"name\":\"chitblog\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"it-IT\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/321ffb3802ecc0a2fc461c52e31fbbabb19873df19bfb793c8e64c6a0cc49313?s=96&d=identicon&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/321ffb3802ecc0a2fc461c52e31fbbabb19873df19bfb793c8e64c6a0cc49313?s=96&d=identicon&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/321ffb3802ecc0a2fc461c52e31fbbabb19873df19bfb793c8e64c6a0cc49313?s=96&d=identicon&r=g\",\"caption\":\"chitblog\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"DIY Motion Detection Surveillance System With Audio and Alarm &#8226; CHIT","description":"Guide on how to install and configure the motion surveillance system with motion detection with audio, alarm and how to use multiple webcams.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/christeninformatica.ch\/it\/motion-detection-audio-surveillance-linux-diy-usb-webcam-configuration-installation-alarm\/","og_locale":"it_IT","og_type":"article","og_title":"DIY Motion Detection Surveillance System With Audio and Alarm &#8226; CHIT","og_description":"Guide on how to install and configure the motion surveillance system with motion detection with audio, alarm and how to use multiple webcams.","og_url":"https:\/\/christeninformatica.ch\/it\/motion-detection-audio-surveillance-linux-diy-usb-webcam-configuration-installation-alarm\/","og_site_name":"CHIT","article_published_time":"2025-07-21T22:28:00+00:00","article_modified_time":"2025-08-26T20:13:53+00:00","og_image":[{"width":1024,"height":768,"url":"https:\/\/christeninformatica.ch\/media\/guide-diy-surveillance-system-with-motion-detection-alarm.jpg","type":"image\/jpeg"}],"author":"chitblog","twitter_card":"summary_large_image","twitter_misc":{"Written by":"chitblog","Est. reading time":"7 minuti"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/christeninformatica.ch\/motion-detection-audio-surveillance-linux-diy-usb-webcam-configuration-installation-alarm\/#article","isPartOf":{"@id":"https:\/\/christeninformatica.ch\/motion-detection-audio-surveillance-linux-diy-usb-webcam-configuration-installation-alarm\/"},"author":{"name":"chitblog","@id":"https:\/\/christeninformatica.ch\/#\/schema\/person\/b0952e900860b424a6b0906f1d6a0a64"},"headline":"DIY Motion Detection Surveillance System With Audio and Alarm","datePublished":"2025-07-21T22:28:00+00:00","dateModified":"2025-08-26T20:13:53+00:00","mainEntityOfPage":{"@id":"https:\/\/christeninformatica.ch\/motion-detection-audio-surveillance-linux-diy-usb-webcam-configuration-installation-alarm\/"},"wordCount":1085,"commentCount":0,"image":{"@id":"https:\/\/christeninformatica.ch\/motion-detection-audio-surveillance-linux-diy-usb-webcam-configuration-installation-alarm\/#primaryimage"},"thumbnailUrl":"https:\/\/christeninformatica.ch\/media\/guide-diy-surveillance-system-with-motion-detection-alarm.jpg","keywords":["audio","configuration","installation","Linux guide","motion","motion detection","surveillance","tutorial"],"articleSection":["Tutorials"],"inLanguage":"it-IT","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/christeninformatica.ch\/motion-detection-audio-surveillance-linux-diy-usb-webcam-configuration-installation-alarm\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/christeninformatica.ch\/motion-detection-audio-surveillance-linux-diy-usb-webcam-configuration-installation-alarm\/","url":"https:\/\/christeninformatica.ch\/motion-detection-audio-surveillance-linux-diy-usb-webcam-configuration-installation-alarm\/","name":"DIY Motion Detection Surveillance System With Audio and Alarm &#8226; CHIT","isPartOf":{"@id":"https:\/\/christeninformatica.ch\/#website"},"primaryImageOfPage":{"@id":"https:\/\/christeninformatica.ch\/motion-detection-audio-surveillance-linux-diy-usb-webcam-configuration-installation-alarm\/#primaryimage"},"image":{"@id":"https:\/\/christeninformatica.ch\/motion-detection-audio-surveillance-linux-diy-usb-webcam-configuration-installation-alarm\/#primaryimage"},"thumbnailUrl":"https:\/\/christeninformatica.ch\/media\/guide-diy-surveillance-system-with-motion-detection-alarm.jpg","datePublished":"2025-07-21T22:28:00+00:00","dateModified":"2025-08-26T20:13:53+00:00","author":{"@id":"https:\/\/christeninformatica.ch\/#\/schema\/person\/b0952e900860b424a6b0906f1d6a0a64"},"description":"Guide on how to install and configure the motion surveillance system with motion detection with audio, alarm and how to use multiple webcams.","breadcrumb":{"@id":"https:\/\/christeninformatica.ch\/motion-detection-audio-surveillance-linux-diy-usb-webcam-configuration-installation-alarm\/#breadcrumb"},"inLanguage":"it-IT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/christeninformatica.ch\/motion-detection-audio-surveillance-linux-diy-usb-webcam-configuration-installation-alarm\/"]}]},{"@type":"ImageObject","inLanguage":"it-IT","@id":"https:\/\/christeninformatica.ch\/motion-detection-audio-surveillance-linux-diy-usb-webcam-configuration-installation-alarm\/#primaryimage","url":"https:\/\/christeninformatica.ch\/media\/guide-diy-surveillance-system-with-motion-detection-alarm.jpg","contentUrl":"https:\/\/christeninformatica.ch\/media\/guide-diy-surveillance-system-with-motion-detection-alarm.jpg","width":1024,"height":768},{"@type":"BreadcrumbList","@id":"https:\/\/christeninformatica.ch\/motion-detection-audio-surveillance-linux-diy-usb-webcam-configuration-installation-alarm\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/christeninformatica.ch\/"},{"@type":"ListItem","position":2,"name":"DIY Motion Detection Surveillance System With Audio and Alarm"}]},{"@type":"WebSite","@id":"https:\/\/christeninformatica.ch\/#website","url":"https:\/\/christeninformatica.ch\/","name":"CHIT","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/christeninformatica.ch\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"it-IT"},{"@type":"Person","@id":"https:\/\/christeninformatica.ch\/#\/schema\/person\/b0952e900860b424a6b0906f1d6a0a64","name":"chitblog","image":{"@type":"ImageObject","inLanguage":"it-IT","@id":"https:\/\/secure.gravatar.com\/avatar\/321ffb3802ecc0a2fc461c52e31fbbabb19873df19bfb793c8e64c6a0cc49313?s=96&d=identicon&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/321ffb3802ecc0a2fc461c52e31fbbabb19873df19bfb793c8e64c6a0cc49313?s=96&d=identicon&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/321ffb3802ecc0a2fc461c52e31fbbabb19873df19bfb793c8e64c6a0cc49313?s=96&d=identicon&r=g","caption":"chitblog"}}]}},"_links":{"self":[{"href":"https:\/\/christeninformatica.ch\/it\/wp-json\/wp\/v2\/posts\/1920","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/christeninformatica.ch\/it\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/christeninformatica.ch\/it\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/christeninformatica.ch\/it\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/christeninformatica.ch\/it\/wp-json\/wp\/v2\/comments?post=1920"}],"version-history":[{"count":0,"href":"https:\/\/christeninformatica.ch\/it\/wp-json\/wp\/v2\/posts\/1920\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/christeninformatica.ch\/it\/wp-json\/wp\/v2\/media\/1932"}],"wp:attachment":[{"href":"https:\/\/christeninformatica.ch\/it\/wp-json\/wp\/v2\/media?parent=1920"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/christeninformatica.ch\/it\/wp-json\/wp\/v2\/categories?post=1920"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/christeninformatica.ch\/it\/wp-json\/wp\/v2\/tags?post=1920"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}