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.

Step 2: Configure the Software

Next we need to edit some of the config files so that the motion service will start on run up and be available on local network.

First we will edit the motion.conf file by typing:
$ sudo nano /etc/motion/motion.conf

This is quite a large conf file but the points you need to edit are:
DAEMON = OFF (change to ON)
Webcam_localhost = ON (Change to OFF)

Step 3: Set the Service Up

Next we need to enable the Daemon (service):
$ sudo nano /etc/default/motion

start_motion_daemon = no (change to yes)

Step 4: Start Her Up :)

Ensure your webcam is plugged into the usb port on your Raspberry Pi and start the service:
$ sudo service motion start

If you want to stop the service then use the command:
$ sudo service motion stop

 With the service started you can now open a webpage on your normal computer and by going to the IP of the Raspberry pi on port 8081 (in the address bar) you should be able to view your webcam (please note that the one in the picture shows port 8089 as I have set this up in the conf file. The default port is 8081):

I hope you have enjoyed this instructable and in the near future I will do a guide to allow you to view your webcam over the internet. The reason I have this is so I can connect my webcam to the eye piece of my telescope and transmit my astroviews over the web so friends and family can see the galaxy.
<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>Hi! I had the same problem and, like others in this thread, noticed that the webcam turned off when motion was detected. The motion config file is set to save pictures when motion is detected. Since I didn't want to store photos nor videos, I disabled these options by setting output_pictures off and ffmpeg_output_movies off in the config file. This allowed the camera to stream without a problem. Jarrad's solution to give permissions to the directory would probably work if you wanted to store pics/videos.</p>
<p>Thanks Ricardo. I've been going through so many pages for the past hour because the webcam stopped streaming after a few seconds. Your fix is working for me. And what JarradD2 below said made sense. &quot;Motion&quot; module doesn't have permission to save photos/videos. I don't know how to give permission so I'm following your route.</p><p>Folks, if you want this to work, make sure you got the following settings correct for /etc/motion/motion.conf:<br>output_pictures off (default on)<br>ffmpeg_output_movies off (default on)<br>stream_localhost off<br>daemon on<br>stream_maxrate 100<br>framerate 100<br>weight xxx<br>height xxx</p><p>webcam_localhost is an outdated variable. The new one is now called stream_localhost</p>
<p>That works perffect for me thanks :)</p>
<p>I think motion is crashing right after it starts- mabe something in your config doesn't match the webcam, like the resolution (called width and height).</p><p>I have a Logitech c310 and I know it does work also maybe try reinstalling motion after an &quot;apt-get update&quot;</p>
<p>I had a similar problem until I placed the camera in a position where there was no motion for it to detect. I'm thinking the motion detection is too resource hungry for the Pi?</p>
<p>Got it going on mine, you need to make sure it has permissions for the directory where it saves the photos/videos. I found this out in the syslog. And make sure you have ffmpeg installed</p>
<p>Works like a charm! &lt;3 I configured the &quot;motion.conf&quot; and set the &quot;stream_maxrate&quot; to 30 fps which works very good! If you also want a password, just search for &quot;auth&quot; and remove the &quot;;&quot; sign and set the &quot;username:password&quot; to whatever you'd like! I added an image to show you the setup, but it's very blurry.</p>
<p>hello. Sir please help me, how give a password in motion ? I try but it's not work</p>
<p>Not sure why the image decided to flip upside-down, but w/e</p>
<p>how do i delete a write protected directory in rpi?</p>
<p>Might I add a suggestion. I did not see it in the comments, but I have found it best to open the stream in VLC Media Player rather than a browser window. A browser window always lead to the eventual stoppage of the stream and the browser displaying a still image of the last frame captured. Using VLC to capture and display the stream eliminates this problem</p>
<p>One cool thing you can do with the remote camera is view it from your iPhone</p><p>just enter the IP and port in safari rather than on your pc or mac</p>
<p>Got mine working, but on iPhone the video shows, then disappears and the page just keeps loading - does yours continue to stream?</p>
<p>I would like to build a super 8 to digital movie converter from a Raspberry Pi. It should work by taking a picture from every frame by using a LED light source and a opto coupler to indicate the frame position. Has anyone already build this? If not, does anyone know how to trigger the shutter and save the image at a rate of preferably more than 24 fps?</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>maybe motion is crashing. try reinstalling after apt-get update and going through the config file to see if there are any incompatible settings. also, make sure you have an adequate power supply (2 amp instead of 1 is probably better)I could be totlally wrong I am in no way an expert at this so I may be wrong</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>To view locally use a URL of localhost or follower by':8080'. E.g.</p>
<p>Hi </p><p>I cant find a line called Webcam_Localhost</p>
<p>i believe its now under a different name. try searching for just local host or just scrolling till you find it. I may be wrong but I think its just called stream_localhost</p>
<p>sorry, didnt realize u got answered...</p>
<p>Try type &quot;stream&quot; instead &quot;Webcam&quot; That should help. &quot;stream_Localhost&quot;</p>
Its there alight although I have problems finding every time for some reason
<p>Me too, please help</p>
<p>Try type &quot;stream&quot; instead &quot;Webcam&quot; That should help. &quot;stream_Localhost&quot;</p>
<p>Hi - I couldn't find that line either. I was using 'jessie' on an RPi model 1 as my base operating system. Installing motion on this didn't seem to give me the correct settings in motion.conf.</p><p>I reinstalled with 'wheezy' version of Raspian, then installed motion..... and there they all were. It might have just been the re-install..... but I'm betting it was the version of motion that wheezy pulled in that solved the problem.</p>
<p>Hi - I couldn't find that line either. I was using 'jessie' on an RPi model 1 as my base operating system. Installing motion on this didn't seem to give me the correct settings in motion.conf.</p><p>I reinstalled with 'wheezy' version of Raspian, then installed motion..... and there they all were. It might have just been the re-install..... but I'm betting it was the version of motion that wheezy pulled in that solved the problem.</p>
<p>Thank you. A bit of configuration needed to disable only localhost streaming:<br>stream_localhost false</p>
<p>easy to make camera usb view via LAN network/ internet</p><p>http://engineer2you.blogspot.com/2016/05/raspberry-local-ip-webcam-usb.html</p>
<p>Thanks for the great Instructable. It works perfectly! </p><p>Is there a way I can add more information to the web page? I have a temp sensor and would like to have the data displayed on the same page. </p><p>Bruster</p>
<p>So I can connect to it through port 8080, but there is no video feed, just a screen that says</p><p><strong>Motion 3.2.12+git20140228 Running [1] Threads</strong><br><br><a href="" rel="nofollow">All</a></p><p>When I click on the ALL, it shows another blank screen that says </p><p><a href="" rel="nofollow">&lt;&ndash; back</a><br><br><br><strong>Thread 0</strong><br><br><a href="" rel="nofollow">config</a><br><br><a href="" rel="nofollow">action</a><br><br><a href="" rel="nofollow">detection</a><br><br><a href="" rel="nofollow">track</a></p><p>None of these links has a video feed in them.</p><p></p><p>Any ideas?<br></p>
<p>try port 8081</p>
<p>that's the webcontrol interface. check the settings in the motion.conf file in section &quot;HTTP Based Control&quot;.</p><p>BTW: standard port for the video is port 8081, not 8080. maybe it's just that?! if not contact me, i think we can figure that problem out quickly...</p>
<p>And by &quot;blank screen&quot; I just mean it doesn't have anything else other than the text and links: no images, no video, nothing.</p>
<p>hey </p><p>I have set everything up but don't know how to actually view the camera </p><p>I'm new to this so please help</p>
<p>open webbrowser and enter hostip:8081</p>
<p>Can anyone explain in detail or provide me the link where i can read what does 'motion' software do?</p>
<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>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>

About This Instructable




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