Instructables
loading
loading
Picture of Raspberry Pi remote webcam
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: 192.168.1.105)
 
Remove these adsRemove these ads by Signing Up

Step 1: Getting started

Picture of Getting started
step02.jpg
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

Picture of 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

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

start_motion_daemon = no (change to yes)
1-40 of 72Next »
CédricV26 hours ago

You can also use Kerberos.io, it's also open-source and a lot more user friendly to install and configure. You can find more information on the website.

KikeV5 days ago

How can I have less delay?

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

tllittle29 days ago

I have followed all of the instructions so far. My webcam light will activate after "motion start."

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.

Any thoughts?

kaneb17 months ago

it s ok with mozilla firefox.... but the streaming is 3 - 4 seconds dalay ..... is it normal ??? is there an instruction to cut delay ??

cr4qsh0t kaneb11 month ago

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).

Kriatyrr1 month ago

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.

Yolo_Joe1 month ago

Is there any way to modify the resolution? Right now it's 320x240p..

sat481 (author) 1 year ago

Hi Ian,

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 192.168.1.105:8080). See if you can access this and if so check the configuration from there. Hope this helps.

Sat

GeorgeT7 sat4811 month ago

Is there any way to change the default port? 8080 and 8081 seem to be occupied in my LAN connection.

labmice13 months ago

This works for me with a logitech webcam connected. How can I put a password on the stream? Thanks

AltGrW labmice12 months ago

you can set .htaccess into this folder, it's a simple login required but works fine

carter54 AltGrW1 month ago

...'you can set .htaccess into this folder, it's a simple login required but works fine'...

Please elaborate - which folder and where / when do you log in?

AltGrW carter541 month ago

# I've created this example using apache2

# create the htaccess file

pico /var/www/webcam/.htaccess

# htaccess content

AuthType Basic

AuthName "Alert!"

AuthUserFile /var/www/webcam/.htpasswd

require valid-user

# create user (replace the USER)

htpasswd -c /var/www/webcam/.htpasswd USER

# now you must configure the file /etc/apache2/sites-available/default

pico /etc/apache2/sites-available/default

# now you add the content below after the original content

Alias /webcam /var/www/webcam

<Directory "/var/www/webcam">

Options Indexes MultiViews

AllowOverride All

Order allow,deny

Allow from all

</Directory>

# After you finish the configuration above, restart the service

service apache2 restart

# and try to access the folder in the browser

http://YourWebServerIP/webcam

# You must see the authentication alert box, put the user that you created and password

Mine isn't working, everything looks correct, but i ain't getting any image on my IP

Are you using Google Chrome? In that case; don't.

did not work for me

just blank screen like there is nothing at the other end. on local lan even

carter541 month ago

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.

sysnajar made it!1 month ago

Thanks for the super easy instructions. Really well written.

Owat

Screen Shot 2558-03-27 at 4.48.00 PM.png
dsaze3 months ago

When I try: 1.) sudo apt-get install motion

everything works perfectly fine except for a single "get" error (error shown in image below).

ALSO:

2) sudo nano /etc/motion/motion.conf (brings up a file with no text within)

3.) sudo service motion start (yields - "motion: unrecognized service")

raspberry pi error.JPG

you need to update your pi, execute the command sudo apt-get update

mk2001 dsaze2 months ago

The file was empty and the service wasnt recognised because the file did not download properly. Check your internet connection.

DhruvMC2 months ago

i made a gr8 wiimote control with

http://www.raspberrypi-spy.co.uk/2013/02/nintendo-wii-remote-python-and-the-raspberry-pi/ i combined it with this ITS AWESOMEEE....

ramgarden made it!7 months ago

I made one of these with the raspberry pi camera module and attached the pi and camera to our Makerbot Replicator2 3D printer so we could remotely watch our prints to check their progress. Thanks for these simple instructions!

20141026_205004.jpg

Im doing the same thing but im mounting it over our rotary engraver!

garyi sdthedawson2 months ago

Also doing the exact same thing. I hope...

AnshulM ramgarden2 months ago

Hey ramgarden!

Could you give me some details regarding the conf file when you tried it with the Camera Module instead of an USB Camera.

1) what was the videodevice?
eg in this it was videodevice /dev/video0
Did you change it?
2)What was the value for input? (Default is 8)
3) Did you have to make any other changes in the conf file?

ramgarden AnshulM2 months ago

I tried over and over to make it work with the motion application but it just doesn't like the RPi camera module. The best one I've found with the camera module is the MJPEG application: http://blog.miguelgrinberg.com/post/stream-video-from-the-raspberry-pi-camera-to-web-browsers-even-on-ios-and-android

AnshulM ramgarden2 months ago

Yes, I had followed this tutorial already and made it work with MJPEG Streamer. But I need it to work with Motion. Since I need to interface multiple cameras - One USB and one RPi Module. Running the same service Motion and uplinking their live streams to two different ports. Is there no way that's possible?

mk20012 months ago

why isnt it working on chrome

for michaelv4: sorry for my late response, i didn't visit this pages for a couple of months.....

Now i have 2 webcam connected and i did some work on the conf files so i have a good frame rate on both cam and a delay of less than a second. I don't know how to make a toturial here, if someone help me on this i will share my job with all of you that are interested.

Hello Walter!

I'm very new to RPi. I just finished interfacing a USB webcam as per the above tutorial and other help I found online.
Also, I managed to do the same with the Raspberry Pi Camera Module but for that, I was not running Motion, but was running another service (Mjpeg-streamer)
(I used this tutorial for reference:
http://blog.miguelgrinberg.com/post/stream-video-f...)

Now I had a few of doubts..

1) Could I run the same "motion" service for the other Camera Module (Not USB), just by changing the Device ID in the conf file or something?
2) Basically I need the live video stream of 3 cameras at once. So if (1) mentioned above is possible, I was planning to connect 2 USB Cameras and 1 RPi Camera Module, and run the Motion Service. Could that serve the purpose? If so, what will the changes be in the conf file? Do I need to create three instances of 'videodevice'? How can I set the ports as 8081, 8082 and 8083 for the three devices?

riminsalass3 months ago

I use a camera sony playstation 2 EYE TOY "Bus 001 Device 005 : ID 054c : 0155 Sony Corp." and I did all the configuration request without result.

GANESHA13 months ago

it cool but i wanna do it in my console .

and i have one more doubt how to differentiate if two camera's are connected to one pi how can i differentiate it

GANESHA13 months ago

it cool but i wanna do it in my console .

and i have one more doubt how to differentiate if two camera's are connected to one pi how can i differentiate it

nb.nb.16543 months ago

when i type sudo service motion start i get
etc/init.d/motion: l: /etc/default/motion: X#: not found

MichaelV44 months ago

Hi plinsky, can you share you work with me?

plinsky5 months ago

Hi, great tutorial.

I followed your tutorial and now i have a little webcam installed on my PI and it works great. I made also a NAT to see it on the web and used an android app to see it on the go. I'm still experimenting (...not sure about this word, i'm not english) but soon i will post all steps to share with you all my experiment.

Iancoates1 year ago

Hi, good tutorial.

I tried it and the only thing that appears in the browser is a load of random characters. Could you please post all the other settings you have from step 3.

thanks, Ian

Hi Iancotes, I am also getting these issues of the strings of text when port forwarding. I have other port forwards set up (remote desktop etc) but this one doesn't seem to like it. Two fresh installs, one running over WiFi and the other over LAN. Any assistance would be SUPER!

Inside the network this is cracking software.

1-40 of 72Next »