Hallo,
ich habe hier eine ältere Webcam, die aufjeden Fall mit dem pi läuft (mittels fswebcam), aber es diesmal bei mir nicht klappt (neue SD Karte, musste alles neu machen):
Code
pi@raspberrypi ~ $ dmesg | grep "video"
[ 8.094634] Linux video capture interface: v2.00
pi@raspberrypi ~ $ 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 0c45:613e Microdia PC Camera (SN9C120)
Anscheinend erkennt er die cam. Auch kann ich sie mit fswebcam als video0 auswählen:
Code
pi@raspberrypi ~ $ sudo fswebcam -r 640x480 -d /dev/video0 -v /tmp/test.jpg
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
src_v4l2_get_capability,87: /dev/video0 information:
src_v4l2_get_capability,88: cap.driver: "sonixj"
src_v4l2_get_capability,89: cap.card: "USB camera"
src_v4l2_get_capability,90: cap.bus_info: "usb-bcm2708_usb-1.3"
src_v4l2_get_capability,91: cap.capabilities=0x85000001
src_v4l2_get_capability,92: - VIDEO_CAPTURE
src_v4l2_get_capability,101: - READWRITE
src_v4l2_get_capability,103: - STREAMING
No input was specified, using the first.
src_v4l2_set_input,181: /dev/video0: Input 0 information:
src_v4l2_set_input,182: name = "sonixj"
src_v4l2_set_input,183: type = 00000002
src_v4l2_set_input,185: - CAMERA
src_v4l2_set_input,186: audioset = 00000000
src_v4l2_set_input,187: tuner = 00000000
src_v4l2_set_input,188: status = 00000000
src_v4l2_set_pix_format,541: Device offers the following V4L2 pixel formats:
src_v4l2_set_pix_format,554: 0: [0x4745504A] 'JPEG' (JPEG)
Using palette JPEG
src_v4l2_set_mmap,693: mmap information:
src_v4l2_set_mmap,694: frames=4
src_v4l2_set_mmap,741: 0 length=233472
src_v4l2_set_mmap,741: 1 length=233472
src_v4l2_set_mmap,741: 2 length=233472
src_v4l2_set_mmap,741: 3 length=233472
Error starting stream.
VIDIOC_STREAMON: Broken pipe
Unable to use mmap. Using read instead.
--- Capturing frame...
Timed out waiting for frame!
Alles anzeigen
Auf einem anderen, nicht mehr vorhandenem raspbianOS konnte ich mit diesem ShellSkript Aufnahmen machen
Spoiler anzeigen
Bash
#!/bin/bash
CAMPIC="/var/www/htdocs/webcam/images/shot_$1.jpg"
LOGFILE="/var/www/htdocs/webcam/images/log.log"
takepicture() {
fswebcam -r 640x480 -d /dev/video0 -q $CAMPIC > $LOGFILE 2>&1
}
takepicture
while [ -n "$(cat $LOGFILE | grep 'Corrupt JPEG data')" ]; do
takepicture
done
Alles anzeigen
Weiß jemand was ich falsch gemacht haben könnte? Ich habe noch einen Treiber gefunden, aber weiß nicht, wie ich diesen zu installieren habe bzw. ob es überhaupt nötig ist oder der Fehler wo anders liegt.
LG
mlt