{"id":2337,"date":"2018-11-03T21:12:09","date_gmt":"2018-11-03T12:12:09","guid":{"rendered":"https:\/\/uda2.com\/blog\/?p=2337"},"modified":"2023-07-07T16:05:54","modified_gmt":"2023-07-07T07:05:54","slug":"raspberry-pi-camera3","status":"publish","type":"post","link":"https:\/\/uda2.com\/blog\/raspberry-pi-camera3\/","title":{"rendered":"Raspberry Pi\u3067\u76e3\u8996\u30ab\u30e1\u30e93 \u9759\u6b62\u753b\u30e1\u30fc\u30eb\u7de8"},"content":{"rendered":"<p>\u30ab\u30e1\u30e9\u306e\u8a2d\u7f6e\u3068\u30e1\u30fc\u30eb\u306e\u6e96\u5099\u304c\u7d42\u308f\u3063\u305f\u306e\u3067\u64ae\u5f71\u30c7\u30fc\u30bf\u3092\u30e1\u30fc\u30eb\u9001\u4fe1\u3059\u308b\u3088\u3046\u306b\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u3044\u3066motion\u304b\u3089\u547c\u3073\u51fa\u3059\u3088\u3046\u306b\u3057\u307e\u3059\u3002<br \/>\n<!--more--><br \/>\nmotion\u306e\u8a2d\u5b9a\u3092\u5909\u66f4\u3059\u308b<br \/>\n<strong>$ sudo vi \/etc\/motion\/motion.conf<\/strong><\/p>\n<pre><code>daemon on\nwidth 1920\nheight 1080\nframerate 10\nthreshold 3000\ntarget_dir \/var\/motion\nwebcam_localhost off\nffmpeg_output_movies off\non_event_end \/var\/motion_setting\/send.sh<\/code><\/pre>\n<p>\u524d\u56de\u306b\u7d9a\u304d\u898b\u6163\u308c\u306a\u3044\u5358\u8a9e\u3060\u3051\u3056\u3063\u304f\u308a\u89e3\u8aac\u3059\u308b\u3068<br \/>\n<em>threshold<\/em>\u306f\u52d5\u4f53\u691c\u77e5\u306e\u7cbe\u5ea6\uff08\u30d4\u30af\u30bb\u30eb\u6570\uff09<br \/>\n<em>ffmpeg_output_movies<\/em>\u306f\u52d5\u753b\u64ae\u5f71\u3059\u308b\u304b<br \/>\n<em>on_event_end<\/em>\u306f\u52d5\u753b\u691c\u77e5\u5f8c\u306e\u30a2\u30af\u30b7\u30e7\u30f3<\/p>\n<p>\u6b21\u306b\u30d5\u30a9\u30eb\u30c0\u5185\u306e\u64ae\u5f71\u30d5\u30a1\u30a4\u30eb\u3092\u5168\u3066\u6dfb\u4ed8\u3057\u30e1\u30fc\u30eb\u9001\u4fe1\u5f8c\u524a\u9664\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u304f\u3002<br \/>\n\uff08\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306e\u7b87\u6240\u306f\u4efb\u610f\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u5165\u308c\u3066\u304f\u3060\u3055\u3044\uff09<br \/>\n<strong>$ sudo vi \/var\/motion_setting\/send.sh<\/strong><\/p>\n<pre><code>#!\/bin\/sh\nfiles=\"\/var\/motion\/*\"\nall_file=\"\"\nfor filepath in ${files}\ndo\n  all_file=${all_file}' -a '${filepath}\ndone\nmutt -s \"\u76e3\u8996\u30ab\u30e1\u30e9\" \"\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\" -c \"\"${all_file}&lt;\"\/var\/motion_setting\/message.txt\"\nsleep 3\nrm \/var\/motion\/*<\/code><\/pre>\n<p>\u30b9\u30af\u30ea\u30d7\u30c8\u306b\u5b9f\u884c\u6a29\u9650\u3092\u4e0e\u3048\u308b<br \/>\n<strong>$ sudo chmod +x \/var\/motion_setting\/send.sh<\/strong><\/p>\n<p>\u305d\u3057\u3066motion\u3092\u518d\u8d77\u52d5\u3059\u308b\u3068\u7121\u4e8b\u30e1\u30fc\u30eb\u304c\u5c4a\u304d\u307e\u3057\u305f\u3002<br \/>\n<strong>$ sudo service motion restart<\/strong><\/p>\n<p>\u305f\u3060\u3001\u3059\u3054\u3044\u91cf\u306e\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u304c\u9001\u3089\u308c\u3066\u304d\u3066\u898b\u308b\u304c\u5927\u5909\u306a\u306e\u3067\u5225\u306e\u65b9\u6cd5\u3092\u63a2\u308b\u3053\u3068\u306b\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30ab\u30e1\u30e9\u306e\u8a2d\u7f6e\u3068\u30e1\u30fc\u30eb\u306e\u6e96\u5099\u304c\u7d42\u308f\u3063\u305f\u306e\u3067\u64ae\u5f71\u30c7\u30fc\u30bf\u3092\u30e1\u30fc\u30eb\u9001\u4fe1\u3059\u308b\u3088\u3046\u306b\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u3044\u3066motion\u304b\u3089\u547c\u3073\u51fa\u3059\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"author":2,"featured_media":2320,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[206],"tags":[327,350,349],"class_list":["post-2337","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-diary","tag-raspberry-pi","tag-350","tag-349"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/uda2.com\/blog\/wp-json\/wp\/v2\/posts\/2337","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/uda2.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/uda2.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/uda2.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/uda2.com\/blog\/wp-json\/wp\/v2\/comments?post=2337"}],"version-history":[{"count":4,"href":"https:\/\/uda2.com\/blog\/wp-json\/wp\/v2\/posts\/2337\/revisions"}],"predecessor-version":[{"id":2622,"href":"https:\/\/uda2.com\/blog\/wp-json\/wp\/v2\/posts\/2337\/revisions\/2622"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/uda2.com\/blog\/wp-json\/wp\/v2\/media\/2320"}],"wp:attachment":[{"href":"https:\/\/uda2.com\/blog\/wp-json\/wp\/v2\/media?parent=2337"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/uda2.com\/blog\/wp-json\/wp\/v2\/categories?post=2337"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/uda2.com\/blog\/wp-json\/wp\/v2\/tags?post=2337"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}