Piminiuser
Posts: 73
Joined: Wed May 30, 2012 1:15 pm

Webcam stream

Wed Oct 10, 2012 3:52 pm

hi, i found a webcam stream tutorial.

http://www.bobtech.ro/tutoriale/raspber ... spberry-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

User avatar
relnext
Posts: 27
Joined: Wed Sep 26, 2012 5:23 pm
Location: Florida, USA
Contact: Website

Re: Webcam stream

Wed Oct 10, 2012 4:55 pm

have you listed your usb devices?
lsusb

scorp
Posts: 96
Joined: Tue May 29, 2012 6:21 pm

Re: Webcam stream

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

bobtech
Posts: 14
Joined: Fri Sep 14, 2012 7:49 am

Re: Webcam stream

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.

bobtech
Posts: 14
Joined: Fri Sep 14, 2012 7:49 am

Re: Webcam stream

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/raspber ... spberry-pi

Piminiuser
Posts: 73
Joined: Wed May 30, 2012 1:15 pm

Re: Webcam stream

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

bobtech
Posts: 14
Joined: Fri Sep 14, 2012 7:49 am

Re: Webcam stream

Sun Nov 04, 2012 9:15 pm

yes, in that order, one by one

talkeasy
Posts: 37
Joined: Sun Nov 04, 2012 10:57 pm

Re: Webcam stream

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.

Piminiuser
Posts: 73
Joined: Wed May 30, 2012 1:15 pm

Re: Webcam stream

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,

kru64
Posts: 23
Joined: Tue Aug 28, 2012 8:57 am

Re: Webcam stream

Mon Nov 05, 2012 2:43 pm

Try
sudo aptitude install libv4l-0

User avatar
jwilker2
Posts: 44
Joined: Wed Nov 30, 2011 6:55 am
Location: Birmingham, Alabama

Re: Webcam stream

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

Piminiuser
Posts: 73
Joined: Wed May 30, 2012 1:15 pm

Re: Webcam stream

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.

kru64
Posts: 23
Joined: Tue Aug 28, 2012 8:57 am

Re: Webcam stream

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

talkeasy
Posts: 37
Joined: Sun Nov 04, 2012 10:57 pm

Re: Webcam stream

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.

User avatar
jwilker2
Posts: 44
Joined: Wed Nov 30, 2011 6:55 am
Location: Birmingham, Alabama

Re: Webcam stream

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.

Piminiuser
Posts: 73
Joined: Wed May 30, 2012 1:15 pm

Re: Webcam stream

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

kru64
Posts: 23
Joined: Tue Aug 28, 2012 8:57 am

Re: Webcam stream

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.

Skynetz
Posts: 1
Joined: Thu Nov 08, 2012 1:07 pm

Re: Webcam stream

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 ?

xzanfr
Posts: 16
Joined: Wed Jun 20, 2012 12:52 pm

Re: Webcam stream

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)

talkeasy
Posts: 37
Joined: Sun Nov 04, 2012 10:57 pm

Re: Webcam stream

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?

bobtech
Posts: 14
Joined: Fri Sep 14, 2012 7:49 am

Re: Webcam stream

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.

ToddFerrante
Posts: 19
Joined: Sun Sep 30, 2012 8:00 pm

Re: Webcam stream

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.

Capt_Infinity
Posts: 4
Joined: Tue Nov 13, 2012 5:33 pm

Re: Webcam stream

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?

Capt_Infinity
Posts: 4
Joined: Tue Nov 13, 2012 5:33 pm

Re: Webcam stream

Thu Nov 15, 2012 10:19 pm

Actually got this figured out. Just needed to update my browser. Great Pi Cam!

colt45
Posts: 4
Joined: Mon Aug 06, 2012 5:22 pm

Re: Webcam stream

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

Return to “Graphics, sound and multimedia”

Who is online

Users browsing this forum: No registered users and 11 guests