{"id":295,"date":"2012-04-25T09:54:00","date_gmt":"2012-04-25T01:54:00","guid":{"rendered":"http:\/\/blog.hoyo.idv.tw\/?p=295"},"modified":"2020-08-09T09:51:47","modified_gmt":"2020-08-09T01:51:47","slug":"%e6%94%be%e9%9e%ad%e7%82%ae%e7%9a%84%e7%ac%ac%e4%b8%80%e7%89%88%ef%bc%9a%e5%be%9e%e9%a0%ad%e5%88%b0%e5%b0%be%e5%9c%96%e7%89%87%e7%a1%ac%e5%b9%b9%e7%89%88","status":"publish","type":"post","link":"https:\/\/blog.hoyo.idv.tw\/?p=295","title":{"rendered":"\u653e\u97ad\u70ae\u7684\u7b2c\u4e00\u7248\uff1a\u5f9e\u982d\u5230\u5c3e\u5716\u7247\u786c\u5e79\u7248"},"content":{"rendered":"<p>\u4f7f\u7528\u6ce8\u610f\uff0c\u5c07\u4ee5\u4e0b\u6240\u6709\u7a0b\u5f0f\u653e\u7f6e\u5728\u76f8\u540c\u76ee\u9304\u4e4b\u4e0b\u5373\u53ef\u3002<\/p>\n<h1>php \u4e3b\u6a5f\u5e38\u99d0\u80cc\u666f\u57f7\u884c : get.php<\/h1>\n<pre class=\"lang:php decode:true \">&lt;?php\r\nwhile(1){\r\n    exec('wget -q -O cam.jpeg \"http:\/\/camera ip\/pda.cgi?user=\u5e33\u865f&amp;password=\u5bc6\u78bc&amp;page=image&amp;cam=1\"');\r\n    if ( filesize( 'cam.jpeg' ) &gt; 0 ) {\r\n        \/\/ \u5c07\u5b8c\u6210\u5716\u6a94\u8907\u88fd\u5230\u53e6\u5916\u7684\u6a94\u6848\uff0c\u63d0\u4f9b\u7d66\u7db2\u9801\u4f7f\u7528\uff0c\u907f\u514d\u76f4\u63a5\u8b80\u53d6\u8b80\u5230\u672a\u5b8c\u6210\u6a94\u6848\r\n        copy( 'cam.jpeg', 'wcam.jpeg' );\r\n    }\r\n\r\n    \/\/ \u7b49\u5f85 0.25 = \u4e00\u79d2 4 fps\r\n    usleep(250000);\r\n}<\/pre>\n<p>\u5728\u6307\u4ee4\u6a21\u5f0f\u4e0b\u5c07 php \u80cc\u666f\u5e38\u99d0\u57f7\u884c\u3002<\/p>\n<pre class=\"lang:sh decode:true\">php get.php &amp;<\/pre>\n<h1>\u4f7f\u7528 php \u53bb\u8b80\u53d6\u5716\u6a94 : v.php<\/h1>\n<pre class=\"lang:php decode:true\">&lt;?php\r\n$file_name=\"wcam.jpeg\";\r\nreadfile($file_name);\r\n\/\/ readfile() \u4e4b\u5f8c\u4f7f\u7528 flush() \u5c07\u8b80\u5230\u7684\u8cc7\u6599\u91cb\u51fa\r\nflush();<\/pre>\n<p>\u4f7f\u7528\u7a0b\u5f0f\u8b80\u53d6\u5716\u6a94\u7684\u597d\u8655\u662f\u53ef\u4ee5\u929c\u63a5\u5f8c\u7e8c\u7684\u6b0a\u9650\u63a7\u7ba1\uff0c\u76ee\u524d\u53ea\u662f\u7c21\u55ae\u7684\u8b80\u53d6\u52d5\u4f5c\u3002<\/p>\n<h1>\u95dc\u9375\uff01\u4f7f\u7528 jQuery \u7db2\u9801\u4e0d\u505c\u7684\u8b80\u53d6\u66f4\u65b0\u5716\u6a94 : v.html<\/h1>\n<pre class=\"lang:default decode:true \">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n  &lt;script src=\"http:\/\/code.jquery.com\/jquery-latest.js\"&gt;&lt;\/script&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\r\n  &lt;img \/&gt;\r\n\r\n&lt;script&gt;\r\nfunction loadData() {\r\n    $(\"img\").attr({ 'src': \"v.php?\" + Math.random() });\r\n    setTimeout( \"loadData()\", 250);\r\n};\r\n\r\njQuery(document).ready(function($){\r\n    loadData();\r\n});\r\n&lt;\/script&gt;\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>\u4e09\u500b\u6a94\u6848\u6e96\u5099\u5b8c\u6210\u5f8c\uff0c\u5728\u7db2\u9801\u9032\u5165 v.html \u5373\u53ef\u770b\u5230\u7531 v.php \u8b80\u53d6\u7684\u5716\u6a94\u3002\u7576\u7136\uff0cv.php \u8b80\u53d6\u7684\u5716\u6a94\u662f\u7531 get.php \u5411\u7db2\u8def\u651d\u5f71\u6a5f\u64f7\u53d6\u5230\u7684\u756b\u9762\u3002<\/p>\n<ul>\n<li><a href=\"http:\/\/api.jquery.com\/attr\/\" target=\"_blank\" rel=\"noopener\">.attr() \u2013 jQuery API<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/1997901\/how-to-refresh-the-src-of-img-with-jquery\" target=\"_blank\" rel=\"noopener\">How to refresh the src of &lt;img \/&gt; with jQuery?<\/a><\/li>\n<\/ul>\n<p>\u95dc\u9375\u4e00\u70ba\u5982\u4f55\u4f7f\u7528 jQuery \u4f86\u6307\u5b9a\u5716\u6a94\uff0c\u8b93 jQuery \u8a2d\u5b9a setTimeout \u5728 Google Chrome \u700f\u89bd\u5668\u5c31\u53ef\u4ee5\u5f97\u5230\u60f3\u8981\u7d50\u679c\uff0c\u756b\u9762\u4e0d\u9700\u5237\u65b0\u5c31\u53ef\u4ee5\u66f4\u65b0\u5716\u7247\uff0c\u5f97\u5230\u8fd1\u4e4e\u5f71\u7247\u64ad\u653e\u6548\u679c\u3002\u53ea\u662f\u5728 IE \u4ee5\u53ca Firefox \u9084\u662f\u53ea\u986f\u793a\u55ae\u5f35\u5716\u6a94\u7121\u6cd5\u6301\u7e8c\u66f4\u65b0\uff0c\u56e0\u6b64\u9700\u8981\u52a0\u4e0a\u95dc\u9375\u4e8c\u8b93\u5716\u6a94\u9023\u7d50\u6bcf\u6b21\u90fd\u4e0d\u4e00\u6a23\uff0c\u9019\u6a23 IE &amp; Firefox \u624d\u6703\u89ba\u5f97\u9019\u662f\u4e0d\u540c\u6a94\u6848\uff0c\u624d\u6703\u6293\u53d6\u5716\u6a94\u3002<\/p>\n<p>\u4ee5\u4e0a\u65b9\u6cd5\u4f7f\u7528 Internet Explorer 8.0 &amp; Google Chrome 18.0 &amp; Mozilla Firefox 3.6.9 \u6e2c\u8a66\u6210\u529f\uff0c\u4e0d\u9700\u5b89\u88dd\u4efb\u4f55\u8edf\u9ad4\u3002<\/p>\n<p><a href=\"http:\/\/blog.hoyo.idv.tw\/wp-content\/uploads\/2012\/04\/ipcamare_photo_01.jpg\" data-rel=\"lightbox-image-0\" data-rl_title=\"\" data-rl_caption=\"\"><img loading=\"lazy\" class=\"alignnone size-medium wp-image-298\" title=\"\" src=\"\/\/blog.hoyo.idv.tw\/wp-content\/uploads\/2012\/04\/ipcamare_photo_01-300x285.jpg\" alt=\"\" width=\"300\" height=\"285\" srcset=\"https:\/\/blog.hoyo.idv.tw\/wp-content\/uploads\/2012\/04\/ipcamare_photo_01-300x285.jpg 300w, https:\/\/blog.hoyo.idv.tw\/wp-content\/uploads\/2012\/04\/ipcamare_photo_01.jpg 722w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<h1>\u00a0\u6d41\u91cf\u8a66\u7b97<\/h1>\n<p>\u55ae\u5f35 640*480 \u5716\u6a94\u7d04 16,200Bytes \uff0c\u4e00\u79d2 4 \u5f35 = 64,800Bytes = 518400bit<\/p>\n<p>\u4e00\u652f\u93e1\u982d\u5c31\u9700\u8981 512Kbit \u7684\u4e0b\u8f09\u6d41\u91cf\u6709\u9ede\u6050\u6016\uff0c\u5716\u7247\u9700\u8981\u9032\u4e00\u6b65\u58d3\u7e2e\u8655\u7406\uff0c\u800c\u4e14\u5728\u591a\u756b\u9762\u76e3\u770b\u6642\u4e5f\u4e0d\u9700\u8981\u539f\u59cb\u89e3\u6790\u5ea6\uff0c<\/p>\n<p>--<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p class=\"pvc_stats all \" data-element-id=\"295\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> &nbsp;3,847&nbsp;total views, &nbsp;2&nbsp;views today<\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u4f7f\u7528\u6ce8\u610f\uff0c\u5c07\u4ee5\u4e0b\u6240\u6709\u7a0b\u5f0f\u653e\u7f6e\u5728...<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p class=\"pvc_stats all \" data-element-id=\"295\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> &nbsp;3,847&nbsp;total views, &nbsp;2&nbsp;views today<\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[25],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/295"}],"collection":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=295"}],"version-history":[{"count":16,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/295\/revisions"}],"predecessor-version":[{"id":7298,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/295\/revisions\/7298"}],"wp:attachment":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=295"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=295"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}