Posts: 30
Joined: Fri Apr 01, 2016 6:35 pm

Pi 3 and a webcam

Mon Apr 04, 2016 8:45 am

Hi there,

I wonder if anyone can help me - I am trying to get an HD webcam to work with my Pi3 that I have just bought, I am old enough to remember MSDOS so debian is not altogether a stranger - I have programmed in C☺and java so python is making sense as well. However, I am not having a great deal of success at getting a webcam to run (I will eventually want more than one camera). I know my camera are Pi compatible because on one of my attempts I managed to get a load of still images onto the Pi just could not remember exactly what I had done (note to self - make NOTES!!!).

This is where I am up to :-
update, upgrade, rpi-update
Installed motion and libav-tools

I have edited the motion.conf file for what has been recommended but not able to connect to pi and webcam from my LAN - my DHCP server always seems to prefer the pi on but I do check it each time - I will allocated a static IP and port forward to it when I am ready but want to get something working first.
All that happens is I start service motion and try and connect on another machine and just get website not found or is busy or not responding error.

Also I cannot seem to find in the motion.conf file a choice for my captured files to be stored - the PI has a USB drive for this purpose on the dir /media/USB

Anyone got any ideas where to head next???



As a footnote = when I edit motion.conf the deamon is already set to on and there is no mention of the webcam_localhost setting at all - this is supposed to be set to off??

Now getting an avi file and loads of jpg's on my USB drive - Motion log file says it is streaming on port 8081 but still cannot access stream through browser on another machine is there a permission I need to change?

All working now motion.conf needs editing differently from previous versions checking through motion.log file showed me what was wrong :>)))

Posts: 1
Joined: Tue Apr 05, 2016 10:16 am

Re: Pi 3 and a webcam

Tue Apr 05, 2016 10:17 am

Hi, I am currently facing the same issue. Could you please elaborate how you managed to fix this?


Posts: 30
Joined: Fri Apr 01, 2016 6:35 pm

Re: Pi 3 and a webcam

Wed Apr 06, 2016 8:41 am

Hi Selva,

I'll do my best but I am assuming that the issue is a fundamental difference between a Pi 2 (Wheezy) and a Pi 3 (Jessie) and the differences if I am wrong then I'll hold my hand up. Also the differences between ffmpeg and libav-tools.

#firstly check all is up to date

sudo apt-get install rpi-update
sudo rpi-update

sudo apt-get update
sudo apt-get upgrade

#Now for our camera bits and bobs

sudo apt-get install motion
sudo apt-get install libav-tools

#Now plug in your camera and see if the Pi recognizes it with lsusb command


#you should see something like this :-

Bus 001 Device 005: ID ????:???? Something to do with your camera's chipset

# Now it is time to take a look at motion.conf - this is the configuration file that tells your camera what it is supposed to be doing - (if you are following tutorials from the web) this is where you notice something is amiss.

sudo nano /etc/motion/motion.conf

#one of the first thing that differs from the tutorial is that daemon is already on (the default if off) it should be ON - The second is that webcam_localhost doesn't exist ??? this is where things start to go wrong - the config files are slightly different . look for two things logfile and target_dir and make a note of the paths leading to those files. Also change the entry stream_localhost to off this allows streaming to other computers on the local network. Also change the entry webcontrol_localhost to off this allows you to control pan/tilt and zoom remotely if your camera supports it. I also changed the entry output_pictures to first. This means that only the first frame of the stream is saved to the path named in target_dir

Press ctrl-X to save and exit

#to run motion

sudo nano etc/default/motion

# change start_motion_daemon to yes save and exit
# start by typing

sudo service motion start

# that should in theory do it you can check by pointing your browser to the IP addy of your Pi with :8081 at the end ex or if you are unsure then use ifconfig to find out.
# If it doesn't work look at the log file motion.log in the dir pointed to in the motion.conf - This will give you some idea of what works and doesn't and edit accordingly. Hope this helps


Posts: 30
Joined: Fri Apr 01, 2016 6:35 pm

Re: Pi 3 and a webcam

Mon Apr 11, 2016 5:13 pm

Hi there,

Just looking to see if the suggestions worked??

Did for me - any feedback greatly appreciated


Posts: 1
Joined: Wed Apr 20, 2016 8:39 am

Re: Pi 3 and a webcam

Wed Apr 20, 2016 8:50 am

:D Thanks Peers.
All worked except the daemon couldn't write because of a permission issue. This post resolved that for me: ... -directory

Posts: 1
Joined: Sat Jul 22, 2017 6:38 am

Re: Pi 3 and a webcam

Sat Jul 22, 2017 6:47 am


Could anyone help me why the webcam I connected to my Pi3 is blurry?

Here are my settings after installing "Motion":
Framerate = 10
Stream_quality = 100
Quality = 100
Width = 640
Height = 480
Post_capture = 5
Stream_localhost = off
Webcontrol_localhost = off

The webcam is working, however it is blurry. Any help will be highly appreciated. Thanks.


Return to “General discussion”