我最近购买了一个 Rasperry Pi,版本 B,并试图让一个旧的 USB 网络摄像头与动作一起工作,以便我可以通过 http 访问流。我正在使用已经完成更新/升级的 Raspbian。
我相当肯定相机会工作,因为我已经玩了很长一段时间的motion.conf文件,并且多次拔下/重新插入USB相机,并在某个时候录制了2秒的动态视频,但是,我不确定我做了什么让它暂时起作用。
此外,我可以访问控制端口 8089 以及 8081 处的流(在 Firefox 中),但是流是黑色背景,右下角有一个计数器。
控制端口列出了摄像机已连接并且运动检测处于活动状态,但是端口 8081 上的视频流是黑色的。
最后,当我通过控制端口(8089)手动截屏时,截屏是黑色的,好像摄像头被遮住了一样。
也就是说,我决定求助于堆栈向导。
以供参考:
lsusb
与相机有关的输出:
Bus 001 Device 005: ID 0c45:6288 Microdia PC Camera with Microphone (SN9C202 + OV9655)
-编辑:
dmesg
插入 USB 摄像头后收到的输出:
[ 269.597235] usb 1-1.2: new high-speed USB device number 5 using dwc_otg
[ 269.700498] usb 1-1.2: New USB device found, idVendor=0c45, idProduct=6288
[ 269.700530] usb 1-1.2: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[ 269.700546] usb 1-1.2: Product: USB20 Camera
[ 269.784573] media: Linux media interface: v0.10
[ 269.810131] Linux video capture interface: v2.00
[ 269.819113] gspca_main: v2.14.0 registered
[ 269.826148] gspca_main: gspca_sn9c20x-2.14.0 probing 0c45:6288
[ 271.897401] gspca_sn9c20x: OV9655 sensor detected
[ 271.905922] input: gspca_sn9c20x as /devices/platform/bcm2708_usb/usb1/1-1/1-1.2/input/input0
[ 271.910445] usbcore: registered new interface driver gspca_sn9c20x
[ 272.078022] 5:2:1: cannot get freq at ep 0x84
[ 272.091857] usbcore: registered new interface driver snd-usb-audio
[ 278.190887] gspca_sn9c20x: Set 640x480
[ 279.187333] gspca_sn9c20x: Set 640x480
[ 280.158810] gspca_main: ISOC data error: [23] len=0, status=-63
输出来自sudo motion -n
[0] Processing thread 0 - config file /etc/motion/motion.conf
[0] Motion 3.2.12 Started
[0] ffmpeg LIBAVCODEC_BUILD 3482368 LIBAVFORMAT_BUILD 3478785
[0] Thread 1 is from /etc/motion/motion.conf
[0] httpd bind(): Address already in use
[1] Thread 1 started
[0] httpd thread exit
[1] cap.driver: "gspca_sn9c20x"
[1] cap.card: "USB20 Camera "
[1] cap.bus_info: "usb-bcm2708_usb-1.3"
[1] cap.capabilities=0x85000001
[1] - VIDEO_CAPTURE
[1] - READWRITE
[1] - STREAMING
[1] Test palette JPEG (640x480)
[1] Using palette JPEG (640x480) bytesperlines 640 sizeimage 154190 colorspace 00000007
[1] found control 0x00980900, "Brightness", range 0,255
[1] "Brightness", default 127, current 127
[1] found control 0x00980901, "Contrast", range 0,255
[1] "Contrast", default 127, current 127
[1] found control 0x00980902, "Saturation", range 0,255
[1] "Saturation", default 127, current 127
[1] found control 0x00980903, "Hue", range -180,180
[1] "Hue", default 0, current 0
[1] found control 0x0098090e, "Red Balance", range 0,127
[1] "Red Balance", default 40, current 40
[1] found control 0x0098090f, "Blue Balance", range 0,127
[1] "Blue Balance", default 40, current 40
[1] found control 0x00980910, "Gamma", range 0,255
[1] "Gamma", default 16, current 16
[1] found control 0x00980911, "Exposure", range 0,6016
[1] "Exposure", default 51, current 5864
[1] found control 0x00980912, "Gain, Automatic", range 0,1
[1] "Gain, Automatic", default 1, current 1
[1] found control 0x00980913, "Gain", range 0,28
[1] "Gain", default 0, current 0
[1] Error requesting buffers 4 for memory map. VIDIOC_REQBUFS: Device or resource busy
[1] ioctl (VIDIOCGCAP): Inappropriate ioctl for device
[1] Could not fetch initial image from camera
[1] Motion continues using width and height from config file(s)
[1] Resizing pre_capture buffer to 1 items
[1] bind(): Address already in use
[1] Problem enabling stream server in port 8088: Address already in use
[1] Thread exiting
[0] Motion thread 1 restart
[1] Thread 1 started
""""
""""
""""
""""
输出来自lsmod
Module Size Used by
snd_bcm2835 16165 0
snd_usb_audio 116191 0
snd_usbmidi_lib 18267 1 snd_usb_audio
snd_hwdep 5968 1 snd_usb_audio
snd_seq_midi 4682 0
snd_seq_midi_event 6551 1 snd_seq_midi
snd_rawmidi 21357 2 snd_usbmidi_lib,snd_seq_midi
snd_pcm 81593 2 snd_bcm2835,snd_usb_audio
snd_page_alloc 5156 1 snd_pcm
snd_seq 53769 2 snd_seq_midi_event,snd_seq_midi
snd_seq_device 6473 3 snd_seq,snd_rawmidi,snd_seq_midi
snd_timer 20133 2 snd_pcm,snd_seq
snd 58895 9 snd_bcm2835,snd_usb_audio,snd_hwdep,snd_timer,snd_pcm,snd_seq,snd_rawmidi,snd_usbmidi_lib,snd_seq_device
evdev 9325 1
arc4 1683 2
rt2800usb 16720 0
rt2800lib 67499 1 rt2800usb
rt2x00usb 11492 1 rt2800usb
rt2x00lib 44180 3 rt2x00usb,rt2800lib,rt2800usb
gspca_sn9c20x 25601 1
gspca_main 23579 2 gspca_sn9c20x
mac80211 315610 3 rt2x00lib,rt2x00usb,rt2800lib
videodev 111230 3 gspca_sn9c20x,gspca_main
cfg80211 209273 2 mac80211,rt2x00lib
media 13467 1 videodev
crc_ccitt 1529 1 rt2800lib
leds_gpio 2059 0
rfkill 19138 2 cfg80211
led_class 3688 2 leds_gpio,rt2x00lib
如果重要的话,我已经设置了作为守护进程运行的动作。
还有什么我应该检查/更改以使事情正常工作吗?
PS 很明显,我是一个 linux/debian 菜鸟,所以请放轻松。