DIY遠程移動映像監測(tiny6410+USB網路攝影機+motion+yeelink+curl)

來源:互聯網
上載者:User

    看到有部落格上採用motion搭建移動映像監測系統,感覺很強大,但大多缺少遠程監測能力,大多局限於區域網路。OK,筆者手頭剛好有一個30W像素的USB網路攝影機,那麼借用yeelink服務,也來DIY一把,哈哈。

 筆者DIY系列參考文章: 一、目的      DIY一個遠程移動映像監控的系統,可以自動抓拍移動映像並上傳伺服器同時具有定時抓拍功能,實現可以通過web/android/ios/查看或接收警示。效果:提供個連結,歡迎大家圍觀:http://www.yeelink.net/devices/7376 二、軟硬體環境      硬體:tiny6410+USB網路攝影機+有線網路 or USB wifi      軟體:linux+QT/motion/curl/crontab/shell/YeeLink服務 三、移動映像監控實現1、工作原理    所謂移動映像監測,簡單來說就是利用USB網路攝影機定點監測某個地區,平時網路攝影機並不拍照,只有當有移動物體經過時,網路攝影機便自動抓拍(要監測多大物體、按拍照速率都是可調的),並把拍到的映像儲存在指定目錄或網路伺服器,實現無人監控功能。    motion 是一套免費開源的移動映像監測程式。 2、motion移植(在ubuntu中進行的交叉編譯)下載一個motion-3.2.12.tar.gz,通過samba拷到ubuntu下,然後按如下步驟tar zxvf motion-3.2.12.tar.gzcd motion-3.2.12./configure  --prefix=//_install /  --host=arm-linux makemake installmkdir -p /開發板根檔案系統目錄/var/run/motioncp /motion安裝目錄/bin motion /開發板根檔案系統目錄/usr/sbin/cp /motion安裝目錄/etc/motion-dist.conf /開發板根檔案系統目錄/etc/motion/motion.conf 3、motion配置motion.conf中的基本配置見資料1中說明,詳情見“七、詳細操作步驟小結”中提供的下載檔案包。一些重要配置:snapshot_interval 600 //設定定時600s抓拍一次target_dir /dev/shm/motion_pic  //設定抓拍圖片存放路徑snapshot_filename snapshot //設定定時抓拍圖片檔案名稱jpeg_filename %v-%Y%m%d%H%M%S-%q_motion //設定移動抓拍圖片檔案名稱格式,方便後續shell中進行檔案分析處理   2、根據yeelink的api介面上傳資料。在tiny6410 linux系統上採用shell指令碼進行實現。2.1 上傳移動映像抓拍資料指令碼post_motion.sh 
 #!/bin/    YL_ApiKey= YL_URL=http:     # 尋找/dev/shm/ PIC=$( /dev/shm/motion_pic -name  |   -rt |  -n   $PIC > /dev/shm/  -q  /dev/shm/motion_name && status=yes || status=   [ $status =  upcmd=$PIC  $upcmd|           

 

2.2 上傳定時抓拍資料指令碼post_timelapse.sh 
 #!/bin/    YL_ApiKey= YL_URL=http: PIC=/dev/shm/motion_pic/  upcmd=$PIC   $upcmd|

 

六、增加定時運行服務在crontab服務中加入下面加紅的一行, 讓指令碼每分鐘運行一次, 儲存退出。[root@FriendlyARM crontabs]# crontab -e[root@FriendlyARM crontabs]# crond&  // 開啟crond 下面提供了交叉編譯後的可執行檔(交叉工具鏈為:FriendlyARM/toolschain/4.5.1/bin/arm-linux-gcc) http://download.csdn.net/detail/v_hyx/6907379使用說明及操作步驟:
            、拷貝motion所需的動態庫到tiny6410開發板系統的/lib/  /sdcard/motion_lib                    * * * * /dev/shm/post_timelapse.   */ * * * * /dev/shm/post_motion.   [root@FriendlyARM crontabs]# crond&     、拷貝設定檔到/  /sdcard/motion.conf /etc/motion/    motion -c /etc/motion/motion.conf &

 

yeelink的web頁面  移動抓拍到的手指圖片  1、Linux下移植motion到6410開發板(移動映像監測系統) http://blog.csdn.net/l461269717/article/details/80080862、樹莓派玩家5分鐘內將樹莓派-USB網路攝影機與Yeelink串連–最好玩的網頁監控器 http://blog.yeelink.net/?p=4683、linux下的開源移動映像監測程式--motion編譯與配置 http://www.cnblogs.com/qinyg/p/3355707.html 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.