Closed ektus closed 8 years ago
Well in that case just make sure to install the v4l2-utils package.
Once I install that package, there is no crash, but the list of local cameras shows "(no cameras)" and the console reports a timeout:
root@bananapi ~ # apt-get install v4l-utils
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.
Statusinformationen werden eingelesen.... Fertig
Die folgenden NEUEN Pakete werden installiert:
v4l-utils
0 aktualisiert, 1 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
Es müssen noch 0 B von 182 kB an Archiven heruntergeladen werden.
Nach dieser Operation werden 512 kB Plattenplatz zusätzlich benutzt.
Vormals nicht ausgewähltes Paket v4l-utils wird gewählt.
(Lese Datenbank ... 45614 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von .../v4l-utils_1.6.0-2_armhf.deb ...
Entpacken von v4l-utils (1.6.0-2) ...
v4l-utils (1.6.0-2) wird eingerichtet ...
apt-get install v4l-utils 4,86s user 1,20s system 28% cpu 21,175 total
root@bananapi ~ # WARNING: v4l2-ctl command ran for more than 3 seconds
mplayer shows the following output when successfully playing the camera image on screen:
root@bananapi ~ # mplayer tv://
MPlayer2 2.0-728-g2c378c7-4+b1 (C) 2000-2012 MPlayer Team
Cannot open file '/root/.mplayer/input.conf': No such file or directory
Failed to open /root/.mplayer/input.conf.
Cannot open file '/etc/mplayer/input.conf': No such file or directory
Failed to open /etc/mplayer/input.conf.
Playing tv://.
Detected file format: TV
Selected driver: v4l2
name: Video 4 Linux 2 input
author: Martin Olschewski <olschewski@zpr.uni-koeln.de>
comment: first try, more to come ;-)
v4l2: your device driver does not support VIDIOC_G_STD ioctl, VIDIOC_G_PARM was used instead.
Selected device: sun4i_csi
Capabilities: video capture read/write streaming
supported norms:
inputs: 0 = ;
Current input: 0
Current format: NV21
v4l2: ioctl set format failed: Invalid argument
tv.c: norm_from_string(pal): Bogus norm parameter, setting default.
v4l2: ioctl enum norm failed: Inappropriate ioctl for device
Error: Cannot set norm!
Selected input hasn't got a tuner!
v4l2: ioctl set mute failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object file: No such file or directory
[vdpau] Error when calling vdp_device_create_x11: 1
[VO_XV] It seems there is no Xvideo support for your video card available.
[VO_XV] Run 'xvinfo' to verify its Xv support and read
[VO_XV] DOCS/HTML/en/video.html#xv!
[VO_XV] See 'mplayer -vo help' for other (non-xv) video out drivers.
[VO_XV] Try -vo x11.
[ass] auto-open
VIDEO: 640x480 30.000 fps 0.0 kbps ( 0.0 kB/s)
VO: [x11] 640x480 => 640x480 Planar I420
[swscaler @ 0xb5cef980]No accelerated colorspace conversion found from yuv420p to bgra.
[swscaler @ 0xb5cef980]using unscaled yuv420p -> bgra special converter
Selected video codec: RAW I420 [raw]
Audio: no sound
Starting playback...
V: 0.0 619/619 ??% ??% ??,?% 0 0
v4l2: ioctl set mute failed: Invalid argument
v4l2: 621 frames successfully processed, 609 frames dropped.
Exiting... (Quit)
mplayer tv:// 13,04s user 1,03s system 30% cpu 45,523 total
Then there is a bug either in the v4l2 driver or in the v4l2-ctl command itself that makes it hang for more than 3 seconds. If you manually run v4l2-ctl --list-devices
, what does it say?
1 root@bananapi ~ # v4l2-ctl --list-devices :(
sun4i_csi (sun4i_csi sun4i_csi.0):
/dev/video0
root@bananapi ~ #
it runs for 4s from issuing the command until return of prompt.
The problem is that it takes 4 seconds. There's a 3 seconds timeout in motionEye. I might consider increasing it to, say, 5 seconds, but there still is an issue with the underlying driver or something like that.
It's a timeout and normally shouldn't be needed at all. Why not increase it to 10s oder even 30s? The time might be needed if there are many cameras present. Or ask the user like windows does (no response. wait longer?)
Users have reported UI hanging issues due to this command. In most of the cases no useful results have been returned after the command would have exited. Therefore I came up with a 3 seconds timeout after which the server considers the command failed. Normally the results should come up instantly. The idea of "not responding" and further waiting is just overkill.
Long story short, I have increased the timeout to 10 seconds. A USB device not responding for more than 10 seconds is either buggy or dead.
Okay, thank you. I did alter /usr/local/lib/python2.7/dist-packages/motioneye/v4l2ctl.py accordingly, and was rewarded with a working camera :-) Well, sort of. Image quality is bad, brightness is jumping all over the place even with automatic brightness off, picture is unstable even with good indoor lighting and produces continuous motion events. Oh well, let's wait for better drivers then...
As of this weekend, I've got a CSI camera for my Banana PI to play with. After some struggle with missing dependencies, I was able to get MotionEye to start, but it fails as soon as I try to add the camera. The "Add Camera..." dialogue shows in red "An error occured. Refereshing recommended" across the top half of the screen, and the list box for the camera is empty. Here's the corresponding output on the BPi: