error with GStreamer

what’s wrong about that?
GStreamer: Error opening bin: empty pipeline not allowed

When are you seeing the error?

lt said:
Using TensorFlow backend.
2019-08-09 10:34:50.660802: W tensorflow/core/platform/profile_utils/] Failed to find bogomips in /proc/cpuinfo; cannot determine CPU frequency
2019-08-09 10:34:50.661635: I tensorflow/compiler/xla/service/] XLA service 0x3f68f1b0 executing computations on platform Host. Devices:
2019-08-09 10:34:50.661714: I tensorflow/compiler/xla/service/] StreamExecutor device (0): ,
2019-08-09 10:34:50.739878: I tensorflow/stream_executor/cuda/] ARM64 does not support NUMA - returning NUMA node zero
2019-08-09 10:34:50.740194: I tensorflow/compiler/xla/service/] XLA service 0x3da98830 executing computations on platform CUDA. Devices:
2019-08-09 10:34:50.740286: I tensorflow/compiler/xla/service/] StreamExecutor device (0): NVIDIA Tegra X1, Compute Capability 5.3
2019-08-09 10:34:50.740690: I tensorflow/core/common_runtime/gpu/] Found device 0

TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 191 MB memory) -> physical GPU (device: 0, name: NVIDIA Tegra X1, pci bus id: 0000:00:00.0, compute capability: 5.3)
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/ colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.
GStreamer: Error opening bin: empty pipeline not allowed

l’m using a USB cam and it looks ok in cheese.

What command did you run to get that?

from imageai.Detection import VideoObjectDetection
import os
import cv2

execution_path = os.getcwd()

def forFrame(counting,output_array,output_count):
print("FOR FRAME : ",counting)
print("Output for each object : ", output_array)
print(“Output count for unique objects : “,output_count)
print(output_count.values( ))
print(”------------END OF A FRAME --------------”)
counting.value[()] = str(0)

camera = cv2.VideoCapture(0)

detector = VideoObjectDetection()
detector.setModelPath(os.path.join(execution_path , “yolo-tiny.h5”))

custom_objects = detector.CustomObjects(person=True, bicycle=True, motorcycle=True)

video_path = detector.detectCustomObjectsFromVideo(custom_objects=custom_objects,camera_input=camera,
output_file_path=os.path.join(execution_path, “camera_detected_video”),
frames_per_second=15,per_frame_function = forFrame, log_progress=True,display_object_name = True ,save_detected_video=False,


After googling around, The error seems to be related to cv2.VideoCapture

What version of OpenCv are you using? It appears to be using GStreamer to access the camera but it’s not doing it correctly.

l just install opencv == 4.1.1 ,and l forget what it is before.
l can sure it’s 3.4.X

My suggestion is to try with an older version and see if the problem goes away. The easiest way to do that may be to backup and reflash depending on how you installed OpenCV.

Thanks for your suggest,l wii try it!