Webcam stream


37 posts   Page 1 of 2   1, 2
by Piminiuser » Wed Oct 10, 2012 3:52 pm
hi, i found a webcam stream tutorial.

http://www.bobtech.ro/tutoriale/raspberry-pi/78-streaming-webcam-in-format-m-jpg-cu-raspberry-pi

I have a Logitech Quickcam pro 4000

Image

I dont understand the language, but i guess i followed the steps wel..

Code: Select all
sudo aptitude install libv4l-0
ls /dev/video0
wget http://www.bobtech.ro/get?download=36:mjpg-streamer-rpi
mv get\?download\=36\:mjpg-streamer-rpi mjpg-streamer-rpi.tar.gz
tar -zxvf mjpg-streamer-rpi.tar.gz
cd mjpg-streamer
sudo nano mjpg-streamer.sh
./mjpg-streamer.sh start


./mjpg-streamer.sh start will result in a "Failed to start"

And this is the logfile of the mjpg-streamer programm. What's my problem?


Code: Select all
MJPG Streamer Version: svn rev: 3:160M
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 640 x 480
 i: Frames Per Second.: 5
 i: Format............: MJPEG
Unable to set format: 1196444237 res: 640x480
 Init v4L2 failed !! exit fatal
 i: init_VideoIn failed
MJPG Streamer Version: svn rev: 3:160M
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 320 x 240
 i: Frames Per Second.: 5
 i: Format............: MJPEG
Unable to set format: 1196444237 res: 320x240
 Init v4L2 failed !! exit fatal
 i: init_VideoIn failed
MJPG Streamer Version: svn rev: 3:160M
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 320 x 240
www.raspberrypihelp.net - A list of tutorials and more!
Posts: 62
Joined: Wed May 30, 2012 1:15 pm
by relnext » Wed Oct 10, 2012 4:55 pm
have you listed your usb devices?
lsusb
User avatar
Posts: 27
Joined: Wed Sep 26, 2012 5:23 pm
Location: Florida, USA
by scorp » Wed Oct 10, 2012 9:10 pm
I have the same error with cheap webcam.
lsusb return:
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Bus 001 Device 005: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 007: ID 0939:0b15 Lumberg, Inc. Toshiba Stor.E Alu 2 1TB (PX1710E-1HJ0)
Bus 001 Device 012: ID 1e4e:0102
camera is probably last one. video0 exists
Posts: 96
Joined: Tue May 29, 2012 6:21 pm
by bobtech » Thu Oct 11, 2012 6:28 am
There is some problem with your webcam/driver, it should be listed there if recognized.
Unfortunately I have no much Linux experience to help more.
I my case, the Logitech C210 webcam is listed and as you can see from the tutorial, it works pretty well.

It's ok just to run the listed commands, you will need also to modify resolution in the script, but I see you already did.
Posts: 14
Joined: Fri Sep 14, 2012 7:49 am
by bobtech » Tue Oct 30, 2012 9:40 pm
The new script version should fix this problem.
Please try and let me know.
It's available here http://www.bobtech.ro/tutoriale/raspberry-pi/78-streaming-webcam-in-format-m-jpg-cu-raspberry-pi
Posts: 14
Joined: Fri Sep 14, 2012 7:49 am
by Piminiuser » Sat Nov 03, 2012 9:18 pm
Nice! i will try it when i have time :)

i just must do this?

1 sudo aptitude install libv4l-0
2 ls /dev/video0
3 wget http://www.bobtech.ro/get?download=36:mjpg-streamer-rpi
4 mv get\?download\=36\:mjpg-streamer-rpi mjpg-streamer-rpi.tar.gz
5 tar -zxvf mjpg-streamer-rpi.tar.gz
6 cd mjpg-streamer
7 sudo nano mjpg-streamer.sh
8 ./mjpg-streamer.sh start
www.raspberrypihelp.net - A list of tutorials and more!
Posts: 62
Joined: Wed May 30, 2012 1:15 pm
by bobtech » Sun Nov 04, 2012 9:15 pm
yes, in that order, one by one
Posts: 14
Joined: Fri Sep 14, 2012 7:49 am
by talkeasy » Sun Nov 04, 2012 11:04 pm
Hi

I am also getting 'failed to start'. I have installed the latest version of your software. The webcam is detected /dev/video0

Would be great to get this to work!

Thanks.
Posts: 32
Joined: Sun Nov 04, 2012 10:57 pm
by Piminiuser » Mon Nov 05, 2012 1:33 pm
talkeasy wrote:Hi

I am also getting 'failed to start'. I have installed the latest version of your software. The webcam is detected /dev/video0

Would be great to get this to work!

Thanks.


Exactly the same, cam is detected on video0, but "failed to start" Please help,
www.raspberrypihelp.net - A list of tutorials and more!
Posts: 62
Joined: Wed May 30, 2012 1:15 pm
by kru64 » Mon Nov 05, 2012 2:43 pm
Try
sudo aptitude install libv4l-0
Posts: 23
Joined: Tue Aug 28, 2012 8:57 am
by jwilker2 » Mon Nov 05, 2012 3:00 pm
Try modifying mjpg-streamer.sh as follows:

VIDEO_DEV="/dev/video0"
FRAME_RATE="5"
#RESOLUTION="320x240"
RESOLUTION="640x480"
PORT="8080"
YUV="true"
Good luck
User avatar
Posts: 44
Joined: Wed Nov 30, 2011 6:55 am
Location: Birmingham, Alabama
by Piminiuser » Mon Nov 05, 2012 3:37 pm
changed it from false to true. No difference.

Typed "sudo aptitude install libv4l-0" But that package was al ready installed.

Image

Did it all trough putty.
www.raspberrypihelp.net - A list of tutorials and more!
Posts: 62
Joined: Wed May 30, 2012 1:15 pm
by kru64 » Mon Nov 05, 2012 4:47 pm
Check your webcamera to capture static image.
sudo aptitude install fswebcam
after install
fswebcam -d /dev/video0 -r 640x480 test.jpeg
and see at test.img
Posts: 23
Joined: Tue Aug 28, 2012 8:57 am
by talkeasy » Mon Nov 05, 2012 5:36 pm
Hello, got mine to work by changing YUV="true" and by using a different webcam and by setting it to a lower resolution (352x288). Seems the make and model of camera is important. I will upgrade to a better camera in due course.

Thanks for a great piece of software.
Posts: 32
Joined: Sun Nov 04, 2012 10:57 pm
by jwilker2 » Mon Nov 05, 2012 8:22 pm
Just wanted to say thanks, bobtech, the software works great and the instructions were helpful. kru64, thanks for the tip on taking stills as well. I have a 'microscope' pen cam connected to an articulated lamp base and now I can stream magnified web video as well as grab stills.
User avatar
Posts: 44
Joined: Wed Nov 30, 2011 6:55 am
Location: Birmingham, Alabama
by Piminiuser » Wed Nov 07, 2012 4:51 pm
kru64 wrote:Check your webcamera to capture static image.
sudo aptitude install fswebcam
after install
fswebcam -d /dev/video0 -r 640x480 test.jpeg
and see at test.img


The cam works, i had a program (forgot the name) runned direcly on the pi (NO putty) and the cam was working. So i know the combination pi/cam will must work..
www.raspberrypihelp.net - A list of tutorials and more!
Posts: 62
Joined: Wed May 30, 2012 1:15 pm
by kru64 » Wed Nov 07, 2012 5:10 pm
Piminiuser. I see in your photo (10 october) that all two usb connectors are used. Let's try no connect anything to usb, except webcamera. And run programm, of course, by putty.
Posts: 23
Joined: Tue Aug 28, 2012 8:57 am
by Skynetz » Thu Nov 08, 2012 1:13 pm
I have a Canyon USB webcam, model: CNR-WCAM413 and none of this "tutorials" work for me. I tryed to take only a picture with it and that worked. If I do this:
Code: Select all
1 sudo aptitude install libv4l-0
2 ls /dev/video0
3 wget http://www.bobtech.ro/get?download=36:mjpg-streamer-rpi
4 mv get\?download\=36\:mjpg-streamer-rpi mjpg-streamer-rpi.tar.gz
5 tar -zxvf mjpg-streamer-rpi.tar.gz
6 cd mjpg-streamer
7 sudo nano mjpg-streamer.sh
8 ./mjpg-streamer.sh start


it says it's started, but if I go to the webpage (IP of the Pi..) it is saying that the image can't be viewed, cause there are errors in the image. Can someone help me ?
Posts: 1
Joined: Thu Nov 08, 2012 1:07 pm
by xzanfr » Sat Nov 10, 2012 9:22 am
Thanks for all your work on this bobtech.

I've been having a similar issue to the "failed to start" problem - when I execute mjpg-streamer.sh from the desktop via file manager nothing happens. When I execute it from terminal there is a pause then "failed to start" appears however when I go to http://raspberrypi:8080/?action=stream the camera is working perfectly.

So for those that are getting the "failed to start" message it might be worth ignoring it and checking to see if you can connect to the camera anyway.

(I'm using a microsoft webcam via a powered hub in to a headless pi, streaming over the local network)
Posts: 8
Joined: Wed Jun 20, 2012 12:52 pm
by talkeasy » Sat Nov 10, 2012 9:37 am
Webcam is working well now - thanks for a great script.

However, when I try to plug in other USB devices, such as a keyboard and mouse, even through a USB hub, the Pi crashes. Any thoughts?
Posts: 32
Joined: Sun Nov 04, 2012 10:57 pm
by bobtech » Sun Nov 11, 2012 1:08 pm
talkeasy wrote:Webcam is working well now - thanks for a great script.

However, when I try to plug in other USB devices, such as a keyboard and mouse, even through a USB hub, the Pi crashes. Any thoughts?


Possibly the power supply doesn't have enough current for Pi and extra accessories.
Posts: 14
Joined: Fri Sep 14, 2012 7:49 am
by ToddFerrante » Sun Nov 11, 2012 7:11 pm
Thanks for the post.
I already had my camera (Logitech c270) working with guvcview, so I knew it worked. I used your instructions with no changes and had success. It helps to know that the browser looking at the stream needs to use the address "http://IP/?action=stream". Be sure to include the port as part of the address. For me this was "http://192.168.1.10:8080/?action=stream". I now need to experiment with settings. In guvcview, there were large differences in fps times for different camera settings.
Todd F.
Posts: 19
Joined: Sun Sep 30, 2012 8:00 pm
by Capt_Infinity » Tue Nov 13, 2012 8:08 pm
Great thread guys! Great work!
Got everything working with a Microsoft HD Lifecam. When I enter the start command I get a success confirmation and the light on the camera comes on indicating the camera is on.
Only issue I'm having is when I got to the URL indicated above the browser asks to save a file and begins downloading a file. Is there a setting I'm missing or a different URL to be used or a special SW?
Posts: 4
Joined: Tue Nov 13, 2012 5:33 pm
by Capt_Infinity » Thu Nov 15, 2012 10:19 pm
Actually got this figured out. Just needed to update my browser. Great Pi Cam!
Posts: 4
Joined: Tue Nov 13, 2012 5:33 pm
by colt45 » Tue Nov 20, 2012 4:40 am
@bobtech: Thanks for the script and additional info. I do have it working but, I'm having an issue with the feed. I can't get clean photos. It may give me clean photo out of every 100 or so (guessing). I'm using a verified working Logitech QuickCam IM/Connect. I've tried enabling/disabling YUV and changed the framerate. I also adjusted overclocking just in case that was the issue. Also, on with the Pi on wired and wireless networking from two different computers and an IPad(yuk). All clients get the same garbled stream. Here is an example:
http://i.imgur.com/LYyRZ.jpg
Posts: 4
Joined: Mon Aug 06, 2012 5:22 pm