{"id":1114,"date":"2013-02-23T20:08:04","date_gmt":"2013-02-23T09:08:04","guid":{"rendered":"http:\/\/www.madox.net\/blog\/?p=1114"},"modified":"2013-02-23T20:08:04","modified_gmt":"2013-02-23T09:08:04","slug":"tl-wr703n-example-project-4-webcam-streaming","status":"publish","type":"post","link":"http:\/\/www.madox.net\/blog\/2013\/02\/23\/tl-wr703n-example-project-4-webcam-streaming\/","title":{"rendered":"TL-WR703N Example Project 4 : Webcam Streaming"},"content":{"rendered":"<p>Connecting a webcam and using the router to stream video around the place should be one of the easiest things to do. A bit too easy in that I neglected to provide simple instructions on how to set it up.<\/p>\n<p>mjpg-streamer and the necessary drivers are included in the standard images I provide on the <a href=\"http:\/\/www.madox.net\/blog\/projects\/tp-link-tl-wr703n\/\" target=\"_blank\">TP-Link TL-WR703N project page<\/a>.<\/p>\n<p>Preliminary steps :-<\/p>\n<ol>\n<li>Get a router, load it with the <a href=\"http:\/\/www.madox.net\/blog\/projects\/tp-link-tl-wr703n\/\">standard image<\/a>.<\/li>\n<li>Set-up wireless or any other networking changes. \u00a0See an <a href=\"http:\/\/www.madox.net\/blog\/?p=1073\">example here<\/a>.<\/li>\n<li>Plug in the camera<\/li>\n<\/ol>\n<p>Now there are two ways to get mjpg-streamer to auto-start, there is an easy way and an elegant way.<\/p>\n<ul>\n<li><span style=\"line-height: 13px;\">Easy way : Just add the command to the auto start script using LuCi&#8230;<\/span><\/li>\n<li>Elegant way : Edit the configuration files <em>\/etc\/init.d\/mjpg-streamer<\/em>\u00a0and <em>\/etc\/config\/mjpg-streamer<\/em><\/li>\n<\/ul>\n<p>I prefer the easy way you are less likely to screw it up. \u00a0First we should check that the camera works well with mjpg-streamer&#8230;<\/p>\n<ol>\n<li><span style=\"line-height: 13px;\">Telnet\/SSH into the router<\/span><\/li>\n<li>Run the following command :<br \/>\n<blockquote><p><em>mjpg_streamer -i &#8220;.\/input_uvc.so -n -r VGA -f 6 -d \/dev\/video0&#8221; -o &#8220;.\/output_http.so -p 8080 -n&#8221;<\/em><\/p><\/blockquote>\n<p>This command uses VGA (640&#215;480) resolution &#8220;-r VGA&#8221; at 6 frames per second &#8220;-f 6&#8221;.<\/li>\n<li>If that doesn&#8217;t work and an error appears, it most likely means your camera doesn&#8217;t support JPEG images. \u00a0If so, try the following command instead :<br \/>\n<blockquote><p><em>mjpg_streamer -i &#8220;.\/input_uvc.so -n -q 60 -r QVGA -f 6 -d \/dev\/video0&#8221; -o &#8220;.\/output_http.so -p 8080 -n&#8221;<\/em><\/p><\/blockquote>\n<p>This command forces mjpg-streamer to convert into raw into JPEG at (-q) quality 60, at resolution (-r) QVGA, this can be &#8220;160&#215;120&#8221; for example. \u00a0The frame rate is specified by the -f (6). \u00a0This method is MUUUUUUUUCH more CPU intensive and you might have to tweak the resolution and frame rate down.<\/li>\n<li>Using a device connected to the router, use a web browser (e.g. Chrome) to connect to the following to get a live view:<br \/>\n<blockquote><p><em>http:\/\/192.168.1.1:8080\/?action=stream<\/em><\/p><\/blockquote>\n<p>You can also get a single snapshot at:<\/p>\n<blockquote><p><em id=\"__mceDel\">\u00a0http:\/\/192.168.1.1:8080\/?action=snapshot<\/em><\/p><\/blockquote>\n<\/li>\n<li>If you need to play around with the commands, use CTRL-C to kill mjpg-streamer and try again. \u00a0Avoid high resolutions (e.g. 1920&#215;1080) as that will just crash the router. \u00a0I used 640&#215;480 at 25 frames per second relatively happily on a JPEG enabled camera (e.g. Logitech\/Microsoft ones, not the cheap no brand ones).<\/li>\n<li>Once you have a workable set-up, copy the command you have and put it into the local start-up. \u00a0Append the command line with an ampersand &#8220;&amp;&#8221; so it runs in the background. \u00a0e.g.<br \/>\n<blockquote><p><em>mjpg_streamer -i &#8220;.\/input_uvc.so -n -r VGA -f 6 -d \/dev\/video0&#8221; -o &#8220;.\/output_http.so -p 8080 -n&#8221; &amp;<\/em><\/p><\/blockquote>\n<p>Hint &#8211; In Luci, select the Systems tab, then select Startup, scroll down to the Local Startup section and add your command to the box and press save and apply.<em id=\"__mceDel\"><br \/>\n<\/em><\/li>\n<\/ol>\n<p>Enjoy? \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Connecting a webcam and using the router to stream video around the place should be one of the easiest things to do. A bit too easy in that I neglected to provide simple instructions on how to set it up. mjpg-streamer and the necessary drivers are included in the standard images I provide on the &hellip; <a href=\"http:\/\/www.madox.net\/blog\/2013\/02\/23\/tl-wr703n-example-project-4-webcam-streaming\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;TL-WR703N Example Project 4 : Webcam Streaming&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,16],"tags":[53],"class_list":["post-1114","post","type-post","status-publish","format-standard","hentry","category-engineering","category-software-tips-tricks","tag-tl-wr703n"],"_links":{"self":[{"href":"http:\/\/www.madox.net\/blog\/wp-json\/wp\/v2\/posts\/1114","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.madox.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.madox.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.madox.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.madox.net\/blog\/wp-json\/wp\/v2\/comments?post=1114"}],"version-history":[{"count":3,"href":"http:\/\/www.madox.net\/blog\/wp-json\/wp\/v2\/posts\/1114\/revisions"}],"predecessor-version":[{"id":1118,"href":"http:\/\/www.madox.net\/blog\/wp-json\/wp\/v2\/posts\/1114\/revisions\/1118"}],"wp:attachment":[{"href":"http:\/\/www.madox.net\/blog\/wp-json\/wp\/v2\/media?parent=1114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.madox.net\/blog\/wp-json\/wp\/v2\/categories?post=1114"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.madox.net\/blog\/wp-json\/wp\/v2\/tags?post=1114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}