Нашёл WEB-камеру: Open CV (продолжение) ...
Некоторая задержка произошла в связи с обломом моего трафика из-за фокусов DNS: кэширующий DNS systemd
Продолжаем...
Нашёл WEB-камеру: Open CV (продолжение) ...
Код: Выделить всё
user@mint:~/Документы$ ls -l /dev/video*
crw-rw----+ 1 root video 81, 0 янв 17 16:53 /dev/video0
crw-rw----+ 1 root video 81, 1 янв 17 16:53 /dev/video1
user@mint:~/Документы$
Код: Выделить всё
user@mint:~/Документы$ ls -l /dev/v4l/by-id
итого 0
lrwxrwxrwx 1 root root 12 янв 17 16:53 usb-Sonix_Technology_Co.__Ltd._USB_2.0_Camera-video-index0 -> ../../video0
lrwxrwxrwx 1 root root 12 янв 17 16:53 usb-Sonix_Technology_Co.__Ltd._USB_2.0_Camera-video-index1 -> ../../video1
user@mint:~/Документы$
Код: Выделить всё
user@mint:~/Рабочий стол/Face_recognition$ ./vshow.py -h
usage: ./vshow.py <file> | [<camera>]
user@mint:~/Рабочий стол/Face_recognition$ ./vshow.py 123.avi | 0
0: команда не найдена
Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
BrokenPipeError: [Errno 32] Broken pipe
user@mint:~/Рабочий стол/Face_recognition$ ./vshow.py 123.avi
image file: 123.avi
illegal file name: 123.avi
user@mint:~/Рабочий стол/Face_recognition$
Код: Выделить всё
user@mint:~/Рабочий стол/Face_recognition$ ./vshow.py -h
usage: ./vshow.py <file> | [<camera>]
Код: Выделить всё
user@mint:~/Рабочий стол/Face_recognition$ ./vshow.py 123.avi | 0
0: команда не найдена
Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
BrokenPipeError: [Errno 32] Broken pipe
Код: Выделить всё
user@mint:~/Рабочий стол/Face_recognition$ ./vshow.py 123.avi
image file: 123.avi
illegal file name: 123.avi
Код: Выделить всё
user@mint:~/Рабочий стол/Face_recognition$ ./vshow.py
default camera 0
^[
q
^C
(python3:52504): GStreamer-CRITICAL **: 23:45:48.140:
Trying to dispose element pipeline0, but it is in PAUSED instead of the NULL state.
You need to explicitly set elements to the NULL state before
dropping the final reference, to allow them to clean up.
This problem may also be caused by a refcounting bug in the
application or some element.
[ WARN:0] global ./modules/videoio/src/cap_gstreamer.cpp (1053) open OpenCV | GStreamer warning: unable to start pipeline
(python3:52504): GStreamer-CRITICAL **: 23:45:48.140:
Trying to dispose element videoconvert0, but it is in PLAYING instead of the NULL state.
You need to explicitly set elements to the NULL state before
dropping the final reference, to allow them to clean up.
This problem may also be caused by a refcounting bug in the
application or some element.
[ WARN:0] global ./modules/videoio/src/cap_gstreamer.cpp (616) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
(python3:52504): GStreamer-CRITICAL **: 23:45:48.140:
Trying to dispose element appsink0, but it is in READY instead of the NULL state.
You need to explicitly set elements to the NULL state before
dropping the final reference, to allow them to clean up.
This problem may also be caused by a refcounting bug in the
application or some element.
[ WARN:0] global ./modules/videoio/src/cap_v4l.cpp (890) open VIDEOIO(V4L2:/dev/video0): can't open camera by index
Traceback (most recent call last):
File "/home/user/Рабочий стол/Face_recognition/./vshow.py", line 13, in <module>
cap = cv2.VideoCapture( dev )
KeyboardInterrupt
user@mint:~/Рабочий стол/Face_recognition$
У меня всё, описанное в Open CV (продолжение) ..., хоть относительно захвата единичного кадра (имиджа), хоть захвата и сохранения видеопотока - работает "на ура"
Код: Выделить всё
root@wn41:/home/user# lsusb
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 1bcf:2ced Sunplus Innovation Technology Inc.
Bus 001 Device 004: ID 14cd:1212 Super Top microSD card reader (SY-T18)
Bus 001 Device 003: ID 0573:1573 Zoran Co. Personal Media Division (Nogatech)
Bus 001 Device 007: ID 0c45:6340 Microdia Camera
Bus 001 Device 002: ID 10c4:8108 Cygnal Integrated Products, Inc.
Bus 001 Device 006: ID 8087:0aa7 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Код: Выделить всё
root@wn41:/home/user# lsmod | grep uvcvideo
uvcvideo 98304 0
videobuf2_vmalloc 20480 1 uvcvideo
videobuf2_v4l2 24576 1 uvcvideo
videobuf2_common 53248 2 videobuf2_v4l2,uvcvideo
videodev 221184 3 videobuf2_v4l2,uvcvideo,videobuf2_common
mc 53248 5 videodev,snd_usb_audio,videobuf2_v4l2,uvcvideo,videobuf2_common
Код: Выделить всё
[ 271.774798] usb 1-4: new high-speed USB device number 7 using xhci_hcd
[ 271.961656] usb 1-4: New USB device found, idVendor=0c45, idProduct=6340, bcdDevice= 0.00
[ 271.961657] usb 1-4: New USB device strings: Mfr=2, Product=1, SerialNumber=0
[ 271.961658] usb 1-4: Product: USB 2.0 Camera
[ 271.961659] usb 1-4: Manufacturer: Sonix Technology Co., Ltd.
[ 271.965531] uvcvideo: Found UVC 1.00 device USB 2.0 Camera (0c45:6340)
[ 271.985348] uvcvideo 1-4:1.0: Entity type for entity Extension 4 was not initialized!
[ 271.985350] uvcvideo 1-4:1.0: Entity type for entity Processing 3 was not initialized!
[ 271.985351] uvcvideo 1-4:1.0: Entity type for entity Camera 1 was not initialized!
[ 271.985524] input: USB 2.0 Camera: USB Camera as /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4:1.0/input/input22
[ 271.995339] usb 1-4: 3:1: cannot get freq at ep 0x84
[ 272.112912] usb 1-4: 3:1: cannot get freq at ep 0x84
[ 272.137903] usb 1-4: 3:1: cannot get freq at ep 0x84
Код: Выделить всё
root@wn41:/home/user# ls -l /dev/video*
crw-rw----+ 1 root video 81, 0 янв 18 09:24 /dev/video0
crw-rw----+ 1 root video 81, 1 янв 18 09:24 /dev/video1
crw-rw----+ 1 root video 81, 2 янв 18 09:28 /dev/video2
crw-rw----+ 1 root video 81, 3 янв 18 09:28 /dev/video3
Код: Выделить всё
root@wn41:/home/user# ls -l /dev/v4l/by-id
итого 0
lrwxrwxrwx 1 root root 12 янв 18 09:24 usb-RHX-210902_WN_2M_CAMERA-video-index0 -> ../../video0
lrwxrwxrwx 1 root root 12 янв 18 09:24 usb-RHX-210902_WN_2M_CAMERA-video-index1 -> ../../video1
lrwxrwxrwx 1 root root 12 янв 18 09:28 usb-Sonix_Technology_Co.__Ltd._USB_2.0_Camera-video-index0 -> ../../video2
lrwxrwxrwx 1 root root 12 янв 18 09:28 usb-Sonix_Technology_Co.__Ltd._USB_2.0_Camera-video-index1 -> ../../video3
Сейчас этот форум просматривают: нет зарегистрированных пользователей и 2 гостя