google-coral / examples-camera

Small code snippets that show how to stream camera images to a Coral device.
Apache License 2.0
363 stars 114 forks source link

Can't open camera using webcam logitech C310 #22

Closed alan303138 closed 4 years ago

alan303138 commented 4 years ago

Error: gst-stream-error-quark: Internal data stream error. (1): gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: streaming stopped, reason not-negotiated (-4) (classify.py:4022): Gtk-CRITICAL **: 13:14:41.734: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed

(classify.py:4022): Gtk-CRITICAL **: 13:14:41.734: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed

(classify.py:4022): Gtk-CRITICAL **: 13:14:41.734: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed Segmentation fault

THX!

mtyka commented 4 years ago

Is this on a DevBoard ? If so, note that your USB cam will show up as camera 1 not camera 0. Do if you're using gstreamer, set the source to /dev/video1 , if you;re using pygame, change the camera line to pygame.camera.Camera(camlist[1], ...

xav12358 commented 4 years ago

Hello, I get the same trouble on my coral:

`python3 detect.py Loading ../all_models/mobilenet_ssd_v2_coco_quant_postprocess_edgetpu.tflite with ../all_models/coco_labels.txt labels. Detected Edge TPU dev board. Gstreamer pipeline: v4l2src device=/dev/video1 ! video/x-raw,width=640,height=480,framerate=20/1 ! glupload ! tee name=t t. ! queue ! glfilterbin filter=glbox name=glbox ! video/x-raw,format=RGB,width=300,height=300 ! appsink name=appsink emit-signals=true max-buffers=1 drop=true t. ! queue ! glsvgoverlaysink name=overlaysink

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.056: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.060: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.060: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.060: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.060: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.061: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.062: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.062: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.062: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.062: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.062: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.062: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.062: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.063: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.063: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.063: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.063: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.063: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.063: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.063: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.063: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.063: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.063: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.063: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.064: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.064: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.064: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.064: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.065: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.065: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.066: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.066: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.066: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.066: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.066: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.066: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.066: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.066: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.067: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.067: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.067: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.068: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.068: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.068: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.069: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.069: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.069: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.069: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.070: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.070: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.070: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.070: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.071: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.071: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.071: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.072: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.072: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.103: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.103: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.103: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.103: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.104: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.153: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.159: gdk_monitor_get_workarea: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.183: gdk_monitor_get_workarea: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.184: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.185: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.185: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.185: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.185: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.186: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.186: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.186: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.186: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.186: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.186: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.186: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

(detect.py:3952): Gdk-CRITICAL **: 12:51:45.186: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed Segmentation fault `

mtyka commented 4 years ago

But it works with a different camera ? Check your camera's capabilities using v4l2: v4l2-ctl --list-formats-ext -d /dev/video1