Go Down

Topic: Take picture with fswebcam [Solved] (Read 33875 times) previous topic - next topic

stefanos90

Jul 06, 2014, 02:44 pm Last Edit: Jul 08, 2014, 10:25 am by stefanos90 Reason: 1
Hello,
I am trying to get a picture with my webcamera from the Yun.
Code: [Select]

cd /mnt/sda1/
fswebcam test.jpg

And there is the error
--- Opening /dev/video0...
stat: No such file or directory

the fswebcam is trying to find the /dev/video0 there is not something like this at my /dev.

But with lsusb I can see the camera and it is /dev/bus/usb/001/003.
when I try
Code: [Select]
fswebcam 1.jpg -d /dev/bus/usb/001/003
Code: [Select]

--- Opening /dev/bus/usb/001/003...
Trying source module v4l2...
/dev/bus/usb/001/003 opened.
/dev/bus/usb/001/003: Not a V4L2 device?
Trying source module v4l1...
/dev/bus/usb/001/003 opened.
/dev/bus/usb/001/003: Not a V4L device?
VIDIOCGCAP: Inappropriate ioctl for device
/dev/bus/usb/001/003 closed.
Unable to find a source module that can read /dev/bus/usb/001/003.


what can I do?

(From my debian I can take picture with this camera with the same way)
my camera is LifeCam VX-3000

edit: I found an other camera and got a picture, but the quality is very low (2/10)

I am lost now

bolatu

I have the same problem that I have asked and still did not find the solution:


Hi guys,

I have a problem about taking picture from my Logitech HD Webcam C270. I have installed everything properly. However, I have this error when I want to take a picture:

Code: [Select]
root@Arduino:~# cd /mnt/sda1
root@Arduino:/mnt/sda1# fswebcam test.png
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
No input was specified, using the first.
Adjusting resolution from 384x288 to 352x288.
--- Capturing frame...
VIDIOC_DQBUF: No such device
No frames captured.
root@Arduino:/mnt/sda1#
root@Arduino:/mnt/sda1# cd
root@Arduino:~# fswebcam --no-banner --save photo.jpg
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
No input was specified, using the first.
Unable to find a compatible palette format.
root@Arduino:~# fswebcam --no-banner --save photo.jpg
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
No input was specified, using the first.
Unable to find a compatible palette format.


I have checked my systemlog and it didnt recognize my webcam:

Code: [Select]
Jul  4 00:56:16 Arduino kern.info kernel: [ 1211.550000] uvcvideo: Found UVC 1.00 device <unnamed> (046d:0825)
Jul  4 00:56:16 Arduino kern.info kernel: [ 1211.650000] input: UVC Camera (046d:0825) as /devices/platform/ehci-platform/usb1/1-1/1-1.1/1-1.1:1.0/input/input131
Jul  4 00:56:25 Arduino kern.info kernel: [ 1220.940000] usb 1-1.1: USB disconnect, device number 25
Jul  4 00:56:25 Arduino kern.info kernel: [ 1221.190000] usb 1-1.1: new high-speed USB device number 26 using ehci-platform
Jul  4 00:56:25 Arduino kern.info kernel: [ 1221.530000] usb 1-1.1: New USB device found, idVendor=046d, idProduct=0825
Jul  4 00:56:25 Arduino kern.info kernel: [ 1221.530000] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=2
Jul  4 00:56:25 Arduino kern.info kernel: [ 1221.540000] usb 1-1.1: SerialNumber: F4C44090
Jul  4 00:56:26 Arduino kern.info kernel: [ 1221.550000] uvcvideo: Found UVC 1.00 device <unnamed> (046d:0825)
Jul  4 00:56:26 Arduino kern.info kernel: [ 1221.650000] input: UVC Camera (046d:0825) as /devices/platform/ehci-platform/usb1/1-1/1-1.1/1-1.1:1.0/input/input132
Jul  4 00:56:30 Arduino kern.info kernel: [ 1225.550000] usb 1-1.1: USB disconnect, device number 26



sonnyyu

Quote
I found an other camera and got a picture, but the quality is very low (2/10)


Code: [Select]
fswebcam  -i 0 -d v4l2:/dev/video0  --no-banner  --jpeg 95  --save test.jpg

--jpeg 95 will increase quality to 95%.

Quote
From my debian I can take picture with this camera with the same way my camera is LifeCam VX-3000


Make sure driver installed:

Code: [Select]
root@Arduino:/mnt/sda1# ls /dev/video0  -al
crw-r--r--    1 root     root       81,   0 Jul  7 07:08 /dev/video0


Test device :

Code: [Select]
root@Arduino:/mnt/sda1# fswebcam -d v4l2:/dev/video0 -i 0 --list-controls
--- Opening v4l2:/dev/video0...
/dev/video0 opened.
Available Controls        Current Value   Range
------------------        -------------   -----
Brightness                64 (100%)       -64 - 64
Contrast                  15 (50%)        0 - 30
Saturation                50 (39%)        0 - 127
Hue                       0 (50%)         -16000 - 16000
White Balance Temperature, Auto True            True | False
Gamma                     100 (34%)       20 - 250
Power Line Frequency      60 Hz           Disabled | 50 Hz | 60 Hz
White Balance Temperature 5000 (59%)      2800 - 6500
Sharpness                 35 (35%)        0 - 100
Backlight Compensation    0               0 - 1
Adjusting resolution from 384x288 to 352x288.
--- Capturing frame...
Captured frame in 0.00 seconds.
--- Processing captured image...
There are unsaved changes to the image.




sonnyyu

LifeCam VX-3000 might not be UVC device.

http://forum.arduino.cc/index.php?topic=244334.msg1749411#msg1749411

Code: [Select]
opkg update
opkg install kmod-usb-core kmod-video-core kmod-input-core
opkg remove kmod-video-uvc
opkg install kmod-video-gspca-core
opkg install kmod-video-gspca-sonixj


sonnyyu

@bolatu;-

Logitech HD Webcam C270 is UVC device.


For UVC webcam;-

Code: [Select]
opkg update
opkg install kmod-usb-core kmod-video-core kmod-input-core kmod-video-uvc

some time  reboot is needed.



then same as above test driver installed and test device.

stefanos90

#5
Jul 07, 2014, 06:06 pm Last Edit: Jul 07, 2014, 06:28 pm by stefanos90 Reason: 1


Code: [Select]
opkg update
opkg install kmod-usb-core kmod-video-core kmod-input-core
opkg remove kmod-video-uvc
opkg install kmod-video-gspca-core
opkg install kmod-video-gspca-sonixj




with the other camera I can take picture but still the 95 didn't help. Too low quality.
with ls /dev/video0  -al
I can see the driver as you say.
Sometimes I get a full black picture.

also I get the warning
Code: [Select]
--- Capturing frame...
gd-jpeg: JPEG library reports unrecoverable error: Not a JPEG file: starts with 0x16 0x81



Back to VX-3000
I tried to install kmod-video-gspca-sonixj. Sonixj is my driver always from this list
http://eko.one.pl/?p=openwrt-webcam
045E:00F5 kmod-video-gspca-sonixj
but I get this error

Code: [Select]
root@Arduino:~# opkg install kmod-video-gspca-sonixj
Unknown package 'kmod-video-gspca-sonixj'.
Collected errors:
* opkg_install_cmd: Cannot install package kmod-video-gspca-sonixj.


sonnyyu

Code: [Select]
root@Arduino:~# opkg install kmod-video-gspca-sonixj
Unknown package 'kmod-video-gspca-sonixj'.
Collected errors:
* opkg_install_cmd: Cannot install package kmod-video-gspca-sonixj.


Code: [Select]
opkg update
opkg install kmod-video-gspca-sonixj

sonnyyu

#7
Jul 07, 2014, 06:45 pm Last Edit: Jul 07, 2014, 06:56 pm by sonnyyu Reason: 1
Quote
with the other camera I can take picture but still the 95 didn't help. Too low quality.
with ls /dev/video0  -al
I can see the driver as you say.
Sometimes I get a [font=Verdana]full black picture[/font].


Code: [Select]
root@Arduino:/mnt/sda1# fswebcam -d v4l2:/dev/video0 -i 0 --list-controls
--- Opening v4l2:/dev/video0...
/dev/video0 opened.
Available Controls        Current Value   Range
------------------        -------------   -----
Brightness                64 (100%)       -64 - 64


Increase brightness by

Code: [Select]
fswebcam   -i 0 -d /dev/video0  --set brightness=100%
fswebcam -d v4l2:/dev/video0 -i 0 --list-controls


same way to adjust Contrast, Saturation, Hue, Sharpness...

sonnyyu

#8
Jul 07, 2014, 06:50 pm Last Edit: Jul 07, 2014, 06:56 pm by sonnyyu Reason: 1
Code: [Select]
root@Arduino:/mnt/sda1/test# opkg list-installed |grep kmod-video-*
kmod-video-core - 3.3.8-1
kmod-video-uvc - 3.3.8-1
kmod-video-videobuf2 - 3.3.8-1


found out all the installed video kernel driver, remove them all then install correct one again. reboot will help since you are working on kernel.


sonnyyu

Quote
--- Capturing frame...
gd-jpeg: JPEG library reports unrecoverable error: Not a JPEG file: starts with 0x16 0x81


use "--save test.jpg" will help.

Code: [Select]
fswebcam  -i 0 -d v4l2:/dev/video0  --no-banner  --jpeg 95  --save test.jpg

stefanos90

#10
Jul 07, 2014, 07:05 pm Last Edit: Jul 07, 2014, 07:07 pm by stefanos90 Reason: 1

Quote
with the other camera I can take picture but still the 95 didn't help. Too low quality.
with ls /dev/video0  -al
I can see the driver as you say.
Sometimes I get a [font=Verdana]full black picture[/font].


Code: [Select]
root@Arduino:/mnt/sda1# fswebcam -d v4l2:/dev/video0 -i 0 --list-controls
--- Opening v4l2:/dev/video0...
/dev/video0 opened.
Available Controls        Current Value   Range
------------------        -------------   -----
Brightness                64 (100%)       -64 - 64




Code: [Select]
fswebcam   -i 0 -d /dev/video0  --set brightness=100%
fswebcam -d v4l2:/dev/video0 -i 0 --list-controls




removed all then installed correct one again and still getting the same error after
Code: [Select]
opkg update
opkg install kmod-video-gspca-sonixj


"--save test.jpg" helped.

Increased brightness but some times all is black and some times I get the picture, maybe it is something wrong with my board? Should I reset it to the factory default?

sonnyyu

Quote
Increased brightness but some times all is black and some times I get the picture, maybe it is something wrong with my board? Should I reset it to the factory default?


Never hurt,  I reset it to the factory default every few days  anyway.

stefanos90

Ok, Reset is done.

1)Installed fswebcam
2)
Code: [Select]
$ opkg update
$ opkg install kmod-video-uvc


and here we go,
everything is black

my camera is Logitech C170
I checked the system log and there is
Code: [Select]
Jul  7 20:45:03 Yun authpriv.notice dropbear[4007]: Password auth succeeded for 'root' from 192.168.10.11:35783
Jul  7 20:49:01 Yun kern.info kernel: [  611.200000] uvcvideo: Found UVC 1.00 device Webcam C170 (046d:082b)
Jul  7 20:49:01 Yun kern.info kernel: [  611.220000] input: Webcam C170 as /devices/platform/ehci-platform/usb1/1-1/1-1.1/1-1.1:1.0/input/input1
Jul  7 20:49:01 Yun kern.info kernel: [  611.220000] usbcore: registered new interface driver uvcvideo
Jul  7 20:49:01 Yun kern.info kernel: [  611.220000] USB Video Class driver (1.1.1)

stefanos90

I think I found the solution,
the problem was the frames.

The camera gives black because it cant take a picture with one frame.

You have to:
1)skip the first frames with the -S 10
2)or take the pictures with more frames -F 10 (range 1-255) 255 is slow
3) or give more power to camera (usb hub)

so this can give a normal picture.   XD
Code: [Select]
fswebcam  -i 0 -d v4l2:/dev/video0  --jpeg 95  --save test.jpg -S 20 -r 640x480

federicofissore

Well done. Can you change the topic title to "solved" ?

Go Up