![]() |
| ◆ | 前提条件 |
|
ライブカメラサーバー(motion) と Webサーバー(apache) が稼働していることが前提条件 |
|
| ◆ | 異常検知時録画ファイル保存ディレクトリの作成 |
|
[root@centos]# mkdir /home/****/camera <--- 入力(任意の場所) |
|
| ディレクトリの作成場所はどこでも良いが、録画映像をインターネット経由で見られるように公開ディレクトリの中に作成 | |
| アクセス権の変更 | |
|
[root@centos]# chmod 777 /home/****/camera <--- 入力(任意の場所) |
|
| 所有権の変更 | |
|
[root@fcentos]# chown apache:apache /home/****/camera/ <--- 入力(任意の場所) |
|
| ◆ | motion の設定 |
|
[root@centos]# vi /etc/motion/motion.conf <--- 入力 途中略 ############################################################ # Motion Detection Settings: ############################################################ # Threshold for number of changed pixels in an image that # triggers motion detection (default: 1500) threshold 1500 <--- 変更(動体検知を認知する値 数字が小さいほど敏感に認知する) ↓ threshold **** <--- カメラの性能や環境によって違ってくる 一般的には300ぐらいがベターとされている 途中略 ############################################################ # FFMPEG related options # Film (mpeg) file output, and deinterlacing of the video input # The options movie_filename and timelapse_filename are also used # by the ffmpeg feature ############################################################ # Use ffmpeg to encode mpeg movies in realtime (default: off) ffmpeg_cap_new on <--- 確認(off の場合は動体検知した映像を保存しない) 途中略 ############################################################ # Text Display# %Y = year, %m = month, %d = date, # %H = hour, %M = minute, %S = second, %T = HH:MM:SS, # %v = event, %q = frame number, %t = thread (camera) number,# %D = changed pixels, %N = # %i and %J = width and height of motion area, noise level, \n = new line, # %K and %L = X and Y coordinates of motion center # %C = value defined by text_event - do not use with text_event! # You can put quotation marks around the text to allow # leading spaces ############################################################ # Locate and draw a box around the moving object. # Valid values: on, off and preview (default: off)# Set to 'preview' will only draw a box in preview_shot pictures. locate off <--- 変更(動きを検知したところを枠で囲む) ↓ locate on 途中略 # Draw the number of changed pixed on the images (default: off) # Will normally be set to off except when you setup and adjust the motion settings # Text is placed in upper right corner text_changes off <--- 変更(変化があったピクセル数を表示) ↓ text_changes on 途中略 ############################################################ # Target Directories and filenames For Images And Films# For the options snapshot_, jpeg_, # you can use conversion specifiers mpeg_ and timelapse_filename # %Y = year, %m = month, %d = date,# %H = hour, %M = minute, %S = second, # %v = event, %q = frame number, %t = thread (camera) number, # %D = changed pixels, %N = noise level,# %i and %J = width and height of motion area, # %K and %L = X and Y coordinates of motion center # %C = value defined by text_event# Quotation marks round string are allowed. ############################################################ # Target base directory for pictures and films # Recommended to use absolute path. (Default: current working directory) target_dir /var/motion <--- 変更(異常検知時録画ファイル保存ディレクトリ) ↓ target_dir /home/****/camera 以下略 |
|
| ◆ | motion の再起動 |
|
[root@centos]# /etc/rc.d/init.d/motion restart <--- 入力 |
|
| ◆ | ブラウザ確認 |
|
ブラウザを起動し上記で作成した異常検知時録画ファイル保存ディレクトリにアクセスする motion が動体検知し録画されたファイルが列記されているので確認する |
|
| なお、apache の設定で index ファイルが無い場合にフォルダ内を閲覧できないように設定している場合は異常検知時録画ファイル保存ディレクトリのファイル名を直接指定する | |
|
|
|
| サンプル映像は ここ | |
| なお、デフォルトのプレーヤーが Windows Media Player の場合、環境・バージョンによっては対応コーディックがインストールされていないので再生できないので ここ より CCCP (コーディック)をダウンロードしてインストールする | |