2013-01-06 69 views
7

我有一個USB攝像頭(未知品牌,沒有標記),這是我的樹莓派檢測罰款。使用議案上的覆盆子pi的攝像頭流媒體問題

這是的lsusb的輸出

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 0c45:608f Microdia PC Camera (SN9C103 + OV7630) 
Bus 001 Device 005: ID 1267:0103 Logic3/SpectraVideo plc G-720 Keyboard 

然而當我運行運動,使用的/ dev/video0的,唯一的默認的配置改變了分辨率和設置攝像頭主機關閉,因此,我可以流它上的網絡。 這是我的日誌,當我跑運動

Log of 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 3478784 
[0] Thread 1 is from /etc/motion/motion.conf 
[0] motion-httpd/3.2.12 running, accepting connections 
[0] motion-httpd: waiting for data on port TCP 8080 
[1] Thread 1 started 
[1] cap.driver: "sonixb" 
[1] cap.card: "USB camera" 
[1] cap.bus_info: "usb-bcm2708_usb-1.2" 
[1] cap.capabilities=0x05000001 
[1] - VIDEO_CAPTURE 
[1] - READWRITE 
[1] - STREAMING 
[1] Config palette index 8 (YU12) doesn't work. 
[1] Supported palettes: 
[1] 0: S910 (S910) 
[1] 1: BA81 (BA81) 
[1] Selected palette BA81 
[1] Test palette BA81 (480x640) 
[1] Adjusting resolution from 480x640 to 160x120. 
[1] Using palette BA81 (160x120) bytesperlines 160 sizeimage 19200 colorspace 00000008 
[1] found control 0x00980900, "Brightness", range 0,255 
[1]  "Brightness", default 127, current 127 
[1] found control 0x00980911, "Exposure", range 0,1023 
[1]  "Exposure", default 66, current 66 
[1] found control 0x00980912, "Automatic Gain (and Exposure)", range 0,1 
[1]  "Automatic Gain (and Exposure)", default 1, current 1 
[1] found control 0x00980913, "Gain", range 0,255 
[1]  "Gain", default 127, current 127 
[1] mmap information: 
[1] frames=4 
[1] 0 length=20480 
[1] 1 length=20480 
[1] 2 length=20480 
[1] 3 length=20480 
[1] Using V4L2 
[1] Resizing pre_capture buffer to 1 items 
[1] v4l2_next: VIDIOC_DQBUF: EIO (s->pframe 0): Input/output error 
[1] v4l2_next: VIDIOC_QBUF: Invalid argument 
[1] v4l2_next: VIDIOC_QBUF: Invalid argument 
[1] v4l2_next: VIDIOC_QBUF: Invalid argument 
[1] v4l2_next: VIDIOC_QBUF: Invalid argument 
[1] Error capturing first image 
[1] Started stream webcam server in port 8081 
[1] v4l2_next: VIDIOC_QBUF: Invalid argument 
[1] Video device fatal error - Closing video device 
[1] Closing video device /dev/video0 
[1] Retrying until successful connection with camera 
[1] cap.driver: "sonixb" 
[1] cap.card: "USB camera" 
[1] cap.bus_info: "usb-bcm2708_usb-1.2" 
[1] cap.capabilities=0x05000001 
[1] - VIDEO_CAPTURE 
[1] - READWRITE 
[1] - STREAMING 
[1] Config palette index 8 (YU12) doesn't work. 
[1] Supported palettes: 
[1] 0: S910 (S910) 
[1] 1: BA81 (BA81) 
[1] Selected palette BA81 
[1] Test palette BA81 (480x640) 
[1] Adjusting resolution from 480x640 to 160x120. 
[1] Using palette BA81 (160x120) bytesperlines 160 sizeimage 19200 colorspace 00000008 
[1] found control 0x00980900, "Brightness", range 0,255 
[1]  "Brightness", default 127, current 127 
[1] found control 0x00980911, "Exposure", range 0,1023 
[1]  "Exposure", default 66, current 66 
[1] found control 0x00980912, "Automatic Gain (and Exposure)", range 0,1 
[1]  "Automatic Gain (and Exposure)", default 1, current 1 
[1] found control 0x00980913, "Gain", range 0,255 
[1]  "Gain", default 127, current 127 
[1] mmap information: 
[1] frames=4 
[1] 0 length=20480 
[1] 1 length=20480 
[1] 2 length=20480 
[1] 3 length=20480 
[1] Using V4L2 
[1] Camera has finally become available 
[1] Camera image has different width and height from what is in the config file. You should fix that 
[1] Restarting Motion thread to reinitialize all image buffers to new picture dimensions 
[1] Thread exiting 
[1] Calling vid_close() from motion_cleanup 
[1] Closing video device /dev/video0 
[0] Motion thread 1 restart 
[1] Thread 1 started 
[1] config image height (120) is not modulo 16 
[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] Started stream webcam server in port 8081 
[1] Retrying until successful connection with camera 
[1] config image height (120) is not modulo 16 
[0] httpd - Finishing 
[0] httpd Closing 
[0] httpd thread exit 
[1] Thread exiting 
[0] Motion terminating 

相機上的燈亮起時開始,然後再熄滅,沒有人承認任何我發現了錯誤?

謝謝!

+0

我的攝像頭與l4v2兼容,並且我嘗試了其他視頻輸入方法,例如fswebcam。仍然無濟於事。 我還沒有嘗試過的一件事是使用有源USB集線器,目前我只是用700mA的電路板直接使用它,可能不足以運行我的攝像頭。 – FredoAF

+1

通過重新嘗試多次使用我的USB鍵盤和HDMI連接線斷開連接,我可以獲得動作以在出現輸入輸出錯誤之前拍攝一些照片。 所有圖片看起來像這樣 - http://s7.postimage.org/mjb0z2wwn/01_20130115174957_01.jpg 因此,我打算假設我需要更多的電力,並打算購買一個動力的USB集線器,並給予嘗試 – FredoAF

回答

0

我建議你嘗試guvcview而不是運動。它運行得更快,併爲我的Pi提供了更好的圖像。它在X下運行。

guvcview的兩個注意事項 - 將POWER LINE FREQUENCY設置爲本地電源頻率。 - 設置分辨率爲640 x 480.

guvcview佔用大約50%的處理器能力。是的,也使用USB集線器!

Unh。

+0

我嘗試過,但沒有工作。將等待我的USB集線器到達並再次嘗試運動 – FredoAF

1

我認爲你需要將conf文件中圖像的高度和寬度設置爲你的相機規格。我沒有工作,直到我把高度640寬度480.流很好!只需要弄清楚webstream認證的補丁。目前我有這個流媒體到我的網絡服務器,需要登錄,但如果有人輸入我的IP加端口即時通訊,這可以被繞過。

+0

我玩過的分辨率,我認爲在示例我發佈我設置的高度和寬度錯誤的方式 - 調整分辨率從480x640到160x120。所以我會嘗試。 – FredoAF

+0

對不起...寬度680高度480 – Wheezy

+0

是啊這就是我的意思,在我的例子中它調整了480x640到160x120,所以我應該設置它680x480 – FredoAF

1

即使配置文件不同,motion也會使用它在運行時檢測到的可能分辨率(至少在我的經驗中)。

此外,似乎不支持的調色板設置在conf文件中,動作選取其檢測爲支持的兩個中的一個。您是否嘗試將conf文件中的調色板設置更改爲「0」(S910)?

最後,Pi的USB支持有一些已知的問題,至今尚未解決關於大塊數據的問題。降低幀速率也可能有助於其他情況(在這種情況下,我認爲,我不會幫助,因爲該過程已經失敗並顯示第一個圖像)。

1

嘗試v2l4-ctl --list-format-ext查看相機支持像素格式和圖像大小的組合。該S910是一個便宜的舊相機,你可能想升級。

1

您的問題是在日誌中:

config image height (120) is not modulo 16 

所以你需要一個不同的圖像分辨率。

看看您的設備與

$ uvcdynctrl -f 

支持選擇一個具有Y分辨率是16 例如多640x480,如果那個是你的相機列出的。