This will allow you to create a remote webcam for your Raspberry Pi so that you can view it from any computer on the local network. For this instructable you will need:

• Raspberry Pi with an Whezzy Raspbian installed and internet connection established
• Webcam (I use PS3 Eye Camera, but it will work with most USB webcams)
• IP address on your local network (this can be found with the command $ ifconfig and should be something like:

Step 1: Getting started

Run up your Raspberry Pi to the command prompt

Install the webcam server software using the following command:
$ sudo apt-get install motion

This will take a few minutes to download and install but once it has finished and takes you back to the command prompt we are ready to continue.
<p>Swweeeet it work for me!!! had do a few tweaks as other suggested in the comments! it would start then die after a few seconds, changed the frame rate etc. </p><p>Thanks!! :) now on to streaming this to remote site.</p><p>Thanks</p>
<p>Hi Guys, I got it to work, but it only works for so long and then I have to type &quot;sudo service motion restart&quot; it will then work for another minute or so? Any ideas?</p><p> Also, its quite blury with movement, will that be the limitation of the pi or webcam?</p>
<p>is it necessary to have a proxy server to view the video on local network/</p>
<p>have u done ur project ?? I am doing something similar 'll u help me a little ?</p>
Not yet ....will be starting it soon
<p>Great instruction! A tip for anyone who wants to increase the framerate of the streaming is to set the fps to the parameter &quot;webcam_maxrate=xx&quot; in the motion.conf file where XX is the desired frames per second. By default the framerate is 1 fps which gives a bad streaming experience. Unfortunately this parameter is frequently forgoten in most tutorials. 15 fps is working fine for me.</p>
<p>My camera LED comes on after entering the command sudo service motion start however after a few seconds it goes off. Also not able to reach IP address:8080? Any thoughts please?</p>
<p>I was able to keep the camera LED on longer by connecting to Ethernet as oppose to WIFI but still not able to reach via either explorer or firefox. Is there a way to see the streaming video on the Raspberry Pi it self to eliminate the network as a possible issue? I did open a port under NAT/Gaming, range 8080 - 8082...base port 8081 TCP/UDP</p>
<p>For the life of me I can not get this to work. I have followed the instructions to a T.. I have a logitech c310 which I see in lsusb so I know it's there. I finish the instructions and run sudo service motion start.... nothing happens. I figure maybe I should reboot the pi. It comes back up.. and the daemon appears to kick in.. lights on the cam!!! ...then a few seconds after the raspberry is back up and again nothing. sudo service motion start yields no results. I have the files edited correctly, and even turned localhost off for both streaming and management but 8080 and 8081 show nothing. Help? Other options? </p>
<p>i have my final year project ....i want to stream live videos from a simple webcam connect to my raspberry pi ,it should give me a push up notification on my smart phone and then the video streaming should get started...how it will be get done? </p>
<p>good jobs,,working for me,,TY</p>
<p>Nice. This one was pretty easy.</p>
Followed steps, works great! <br>Great job
<p>Works great, also made a tutorial video (this instructable is linked in the description of the video) </p>
First pi project that has worked ! Great!! Cheers! <br>
<p>After using this for a few days I thought of a few other items that would be nice along with a user name and password would adding the ability to turn off the lights on the camera and turn on the microphone. I am using the same camera the author used.</p>
<p>Thanks, this works great. I want to stream the video but was wondering if there was a way to set it up so that a user name and password could be added and how can I make sure that it starts automaticly in the event of a power loss?</p>
<p>How do i start the webcam at boot automatically?</p>
<p>Nice work! I was finally able to get it to work, but I can only get it to work in Firefox browser. Tried Chrome and Internet Explorer but it doesn't work. Chrome acts like nothing was entered at all and Internet Explorer on Windows 10 actually closes the browser after hitting the enter key. Any ideas what the problem could be?</p>
<p>You can also use <a href="https://kerberos.io/" rel="nofollow">Kerberos.io</a>, it's also open-source and a lot more user friendly to install and configure. You can find more information on the website.</p>
<p>Hey Cedric. Saw your work on Kerberos. You've done some amazing work on developing this platform. My question is, will I be able to access my recordings from a remote computer or I'll have to have set a cloud necessarily to do so? I'm familiar with port forwarding so, is it possible to port forward my RPi -running Kerberos- and access it remotely?</p>
<p>Hi Ian,</p><p>I have tried resetting the remote webcam up on a fresh install of wheezy and as long as you only change the bits mentioned it should work fine. check you have the correct IP address, the only thing I can think that may cause the problem is if the webcam is not compatible but from what I have read then the majority should be fine. The whole file from step 3 is massive but another quick test you can do is try going into port: 8080 which is the config port. So you need to type your IP:8080 in the address bar (for me this is set to See if you can access this and if so check the configuration from there. Hope this helps.</p><p>Sat</p>
<p>Is there any way to change the default port? 8080 and 8081 seem to be occupied in my LAN connection.</p>
<p>Yes, ther is a way. In motion.conf find &quot;port&quot; (ctrl+w in nano)</p>
<p>Is there any way to modify the resolution? Right now it's 320x240p..</p>
<p>In motion.conf file search for width(in nano Ctrl+W). Just set width you want, and then set the height you want(it is right below widht). I recommend 640x480, most webcams works with that resolution.</p>
<p>I have followed all of the instructions so far. My webcam light will activate after &quot;motion start.&quot;</p><p>However, I cannot view anything in browser locally, through another machine, with VLC, or any other service. I have enabled port forwarding (and even switched the port number a couple of times). The page simply is not found. </p><p>Any thoughts?</p>
<p>Are you sure you typed correct IP adress? You do not need IP forwarding for this purpose.</p>
<p>Cool tutorial! I made it with the same camera as yours(i have one laying around).</p><p>One question: How i can decrease delay? I want to see the stream right before capture, but i have 1s delay. HELP!</p>
<p>i'm getting a 404 while installing motion. any idea?</p>
<p>sudo apt-get update</p><p>and then try it ;)</p><p>I've downloaded earlier version of libmysqlclient18 and had to &quot;apt-get -f install&quot; and then update.</p>
<p>Great tutorial. Worked perfectly with my Raspberry Pi 2 and Logitech webcam.</p>
Got this going with ease but for the a bit of frustration finding a Web browser that would display the stream. My setup is similar to this picture with the exception that my pi has the UPiS Advanced Uninterruptible Power Intelligent Supply&nbsp;installed. The idea is that I'll set up the camera on a hill overlooking the town I live in and have a link on my website so that people can see what the weather is up to. Now I just need to increase the frame size and decrease the frame rate, and get it to stream live to my website. <br><br>
<p>How can I have less delay?</p>
<p>Hi it was great tutorial its working fine but we need to type the motion start command always is there any code we can browse videos directly raspberry pi board is booted</p>
<p>it s ok with mozilla firefox.... but the streaming is 3 - 4 seconds dalay ..... is it normal ??? is there an instruction to cut delay ??</p>
<p>try setting v4l2_palette to 1 (or try with any other number? default is 8, had the same lag, set it to 1, lag reduced to about 0.5s instead of 4s. it then also applied the changes to width and height settings which previously didn't do anything).</p>
<p>At first I thought it didn't work, even though every step went exactly as described. The light on the webcam would light up when Motion is started and go out when I stopped the service. It just wouldn't display, either in browser or VLC. Then I realized I had to include http:// before the IP:port.</p>
<p>This works for me with a logitech webcam connected. How can I put a password on the stream? Thanks</p>
<p>you can set .htaccess into this folder, it's a simple login required but works fine</p>
<p>...'you can set .htaccess into this folder, it's a simple login required but works fine'...</p><p>Please elaborate - which folder and where / when do you log in?</p>
<p># I've created this example using apache2</p><p># create the htaccess file</p><p>pico /var/www/webcam/.htaccess</p><p># htaccess content</p><p>AuthType Basic</p><p>AuthName &quot;Alert!&quot;</p><p>AuthUserFile /var/www/webcam/.htpasswd</p><p>require valid-user</p><p># create user (replace the USER)</p><p>htpasswd -c /var/www/webcam/.htpasswd USER</p><p># now you must configure the file /etc/apache2/sites-available/default</p><p>pico /etc/apache2/sites-available/default</p><p># now you add the content below after the original content</p><p>Alias /webcam /var/www/webcam</p><p>&lt;Directory &quot;/var/www/webcam&quot;&gt;</p><p>Options Indexes MultiViews</p><p>AllowOverride All</p><p>Order allow,deny</p><p>Allow from all</p><p>&lt;/Directory&gt;</p><p># After you finish the configuration above, restart the service</p><p>service apache2 restart</p><p># and try to access the folder in the browser</p><p><a href="http://yourip/webcam" rel="nofollow">http://YourWebServerIP/webcam</a></p><p># You must see the authentication alert box, put the user that you created and password</p>
<p>Mine isn't working, everything looks correct, but i ain't getting any image on my IP</p>
<p>Are you using Google Chrome? In that case; don't.</p>
<p>did not work for me</p><p>just blank screen like there is nothing at the other end. on local lan even</p>
<p>Thanks for making such a clear and concise instruction which worked for me first time round. Other web sites have covered this but seemed to have got lost in bewildering complexity. Worked first time for me...thanks. Will try to find the instruction for making the feed visible over the web - securly.</p>
<p>Thanks for the super easy instructions. Really well written.</p><p>Owat</p>
<p>When I try: 1.) sudo apt-get install motion</p><p>everything works perfectly fine except for a single &quot;get&quot; error (error shown in image below).</p><p>ALSO:</p><p><em>2) sudo nano /etc/motion/motion.conf (</em>brings up a file with no text within)</p><p>3.) sudo service motion start (yields - &quot;motion: unrecognized service&quot;)</p>
<p>you need to update your pi, execute the command sudo apt-get update</p>

About This Instructable


344 favorites


More by sat481: Raspberry Pi remote webcam
Add instructable to: