Hi Jurmelius,
You made me worry that mjpeg-streamer is not working anymore with the new raspbian.
So I recompile it using a fresh SD card and it is ok.
This is my step by step method for mjpeg-streamer.
It is base from this link
http://wolfpaulus.com/jounal/embedded/r ... pi_webcam/
1 - From a fresh debian
Code: Select all
sudo apt-get update
sudo apt-get upgrade
2 - I install avachi. The bonjour server. This way I could just enter the Rpi hostname , with the .local termination. No need to know the IP.
if you want to change the raspberry name you will need to modify /etc/hosts and /etc/hostname with the new name but before run the application hostname to set it
I change raspberrypi to mypicam
sudo hostname mypicam
sudo nano /etc/hosts and change raspberrypi to mypicam
sudo nano /etc/hostname and change raspberrypi to mypicam
Now we are able to access our Rpi using mypicam.local instead of the IP.
3 - Needed Applications and libraries
Code: Select all
sudo apt-get install subversion
sudo apt-get install libjpeg8-dev
sudo apt-get install imagemagick
sudo apt-get install libv4l-0
sudo apt-get install libv4l-dev
sudo apt-get install uvcdynctrl
4 - Shutdown, power off, install webcam and power ON.
P.S. never shutdown by removing the power. You will corrupt the SD card.
Please install the camera at the top USB port if you have a model B. For some reason my webcam doesn’t work on the bottom one.
5 - Check the Camera
Is the camera is seen by the usb port
This is what I got
pi@mypicam /usr/local/bin $ lsusb
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 045e:0723 Microsoft Corp. LifeCam VX-7000 (UVC-compliant)
Bus 001 Device 005: ID 0bda:8172 Realtek Semiconductor Corp. RTL8191SU 802.11n WLAN Adapter
pi@mypicam /usr/local/bin $
Is the camera is mjpeg capable
And this is what I got
pi@mypicam /usr/local/bin $ uvcdynctrl -f
Listing available frame formats for device video0:
Pixel format: MJPG (MJPEG; MIME type: image/jpeg)
Frame size: 352x288
Frame rates: 30
Frame size: 1600x1200
Frame intervals: 2/15
Frame size: 1280x1024
Frame intervals: 2/15
Frame size: 1024x768
Frame intervals: 2/15
Frame size: 800x600
Frame rates: 30
Frame size: 640x480
Frame rates: 30
Frame size: 320x240
Frame rates: 30
Frame size: 176x144
Frame rates: 30
Frame size: 160x120
Frame rates: 30
pi@mypicam /usr/local/bin $
6 - Download, compile and install mjpeg-streamer
Code: Select all
cd ~
svn co https://svn.code.sf.net/p/mjpg-streamer/code/mjpg-streamer/ mjpg-streamer
cd mjpg-streamer
make USE_LIBV4L2=true clean all
sudo make install
7 - Create a script to run mjpeg-streamer
Code: Select all
sudo nano /usr/local/bin/streamer800x600.sh
Code: Select all
#!/bin/bash
killall mjpg_streamer
/usr/local/bin/mjpg_streamer -i "/usr/local/lib/input_uvc.so -n -f 30 -r 800x600" -o "/usr/local/lib/output_http.so -p 10088 -w /usr/local/www" &
Make the script executable
Code: Select all
sudo chmod +x /usr/local/bin/streamer800x600.sh
Try it
Now we will open an other computer with any browser like safari,firefox or chrome. Don’t use internet explorer because it won’t work!
This will only work locally.
http://mypicam.local:10088
If you use something else than mypicam just change it or use the IP instead with the ":10088" of course
If you want the webcam to run at startup, simply add in /etc/rc.local the following line just before the ¨exit 0¨ line.
Code: Select all
. /usr/local/bin/streamer800x600.sh
P.S. don’t forget the dot.
Daniel