motion是Linux下一款開源的攝像頭監(jiān)控軟件,用命名行運行,只保存有運動物體的圖像。
1. 安裝
sudo apt install motion
- 1
- 1
2. 配置備份配置文件
sudo cp /etc/motion/motion.conf /etc/motion/motion.conf.bak
- 1
- 1
打開配置文檔
sudo vim /etc/motion/motion.conf
- 1
- 1
更改文檔中以下內(nèi)容
width 640 #圖像的寬height 480 #圖像的高target_dir /home/pi/motion-images #圖片保存的路徑stream_localhost off #允許通過網(wǎng)頁查看攝像頭stream_auth_method 2 #開啟密碼認證stream_authentication 用戶名:密碼 #網(wǎng)頁查看攝像頭的用戶名和密碼
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 1
- 2
- 3
- 4
- 5
- 6
- 7
創(chuàng)建一個目錄來存儲Motion拍下的照片
mkdir ~/motion-images
- 1
- 1
官方詳細配置說明:http://lavrsen.dk/foswiki/bin/view/Motion/ConfigFileOptions
3. 運行
sudo motion
- 1
- 1
用瀏覽器登陸樹莓派的網(wǎng)址?192.168.1.105:8081?,會彈出用戶名和密碼的對話框,輸入用戶名和密碼后看到圖像就成功了。
4. 設置為開機運行
sudo vim /etc/rc.local
- 1
- 1
在exit 0前添加 motion , 保存,就會開機自動運行了。
5. 部分詳細配置選項的翻譯
本人英語渣,有翻譯不對的地方請指出
選項Range/Values Default說明auto_brightnessValues: on,off? Default: off讓motion自動調(diào)節(jié)視頻的的亮度,只適用于不帶有自動亮度調(diào)節(jié)的攝像機brightnessValues: 0-255? Default: 0 (disabled)調(diào)整攝像機的亮度saturationValues: 0 - 255? Default: 0 (disabled)調(diào)整攝像機的顏色飽和度hueValues: 0 - 255 Default: 0 (disabled)調(diào)整攝像機的色調(diào)contrastValues: 0-255? Default: 0 (disabled)調(diào)整攝像機的對比度daemonValues: on,off? Default: off以守護進程在后臺運行。這個選項只能放在motion.conf,不能放在 thread config fileemulate_motionValues: on, off? Default: off即使沒有運動物體也要保存圖像ffmpeg_output_moviesValues: on, off Default: off是否保存視頻ffmpeg_bpsValues: 0 - 9999999? Default: 400000視頻比特率ffmpeg_variable_bitrateValues: 0, 2 - 31? Default: 0 (disabled)動態(tài)比特率,如果開啟這個功能ffmpeg_bps將被忽略,0為關(guān)閉,2為最好質(zhì)量,31為最差質(zhì)量ffmpeg_duplicate_framesValues: on, off? Default: on為了達到每秒的幀數(shù)要求,會復制一下幀填充空白時間,關(guān)掉這個功能后每個幀都緊接下一個幀,看起來像快進ffmpeg_output_debug_moviesValues: on, off? Default: off調(diào)試模式,只看到變化的圖像ffmpeg_video_codecValues: mpeg4, msmpeg4, swf, flv, ffv1, mov, ogg, mp4, mkv, hevc? Default: mpeg4視頻格式framerateValues: 2 - 100? Default: 100 (no limit)幀速率,每秒多少幀frequencyValues: 0 - 999999? Default: 0 (Not set)頻率協(xié)調(diào) Hz,(不清楚作用)lightswitchValues: 0 - 100? Default: 0 (disabled)忽略光照強度改變引起的變化locate_motion_modeValues: on, off, preview? Default: off給運動物體用方框標出locate_motion_styleValues: box, redbox, cross, redcross? Default: box標記風格max_movie_timeValues: 0 (infinite) - 2147483647? Default: 3600最大視頻時間minimum_frame_timeValues: 0 - 2147483647? Default: 0最小幀間隔,設置為0表示采用攝像頭的幀率minimum_motion_framesValues: 1 - 1000s? Default: 1捕捉持續(xù)至少指定時間的運動幀movie_filenameValues: Max 4095 characters? Default: %v-%Y%m%d%H%M%S視頻的文件名ffmpeg_timelapseValues: 0-2147483647? Default: 0 (disabled)間隔時間,拍攝延時視頻ffmpeg_timelapse_modeValues: hourly, daily, weekly-sunday, weekly-monday, monthly, manual? Default: daily延時拍攝模式timelapse_filenameValues: Max 4095 characters? Default: %v-%Y%m%d-timelapse延時拍攝的文件名output_picturesValues: on,off,first,best,center? Default: on是否保存圖片和模式設置output_debug_picturesValues: on,off? Default: off圖片調(diào)試模式,只輸出運動物體picture_filenameValues: Max 4095 characters? Default: %v-%Y%m%d%H%M%S-%q圖片文件名picture_typeValues: jpeg,ppm? Default: jpeg圖片類型post_captureValues: 0 - 2147483647? Default: 0 (disabled)運動在持續(xù)多少幀之后才被捕捉pre_captureValues: 0 - 100s? Default: 0 (disabled)輸出圖像包括捕捉到運動的前幾秒qualityValues: 1 - 100 Default: 75jpg圖像的質(zhì)量quietValues: on, off? Default: off安靜模式,檢測到運動不輸出嗶rotateValues: 0, 90, 180, 270? Default: 0 (not rotated)旋轉(zhuǎn)圖像角度stream_auth_methodValues: 0,1,2? Default: 0網(wǎng)頁監(jiān)控身份認證方法:0-無,1-基本,2-MD5stream_authenticationValues: username:password Default: Not defined網(wǎng)頁監(jiān)控用戶名和密碼stream_limitValues: 0 - 2147483647? Default: 0 (unlimited)限制幀的數(shù)量stream_localhostValues: on, off Default: on是否只能本地訪問網(wǎng)絡攝像頭stream_maxrateValues: 1 - 100? Default: 1限制網(wǎng)絡攝像頭幀速率stream_portValues: 0 - 65535? Default: 0 (disabled)網(wǎng)絡攝像頭端口stream_qualityValues: 1 - 100 Default: 50網(wǎng)絡攝像頭傳輸質(zhì)量switchfilterValues: on, off? Default: off過濾器開關(guān),過濾器用來區(qū)分真正的運動和噪聲target_dirValues: Max 4095 characters Default: Not defined = current working directory視頻和圖片的保存路徑videodeviceValues: Max 4095 characters? Default: /dev/video0攝像頭設備名heightValues: Device Dependent Default: 288圖像高度,范圍跟攝像機相關(guān)widthValues: Device Dependent Default: 352圖像寬度,范圍跟攝像機相關(guān)process_id_fileValues: Max 4095 characters? Default: Not defined保存PID的文件,推薦/var/run/motion.piddatabase_busy_timeoutValues: 0 .. positive integer? Default: 0數(shù)據(jù)庫等待超時時間,毫秒
評論