jkjung-avt / tensorrt_demos

TensorRT MODNet, YOLOv4, YOLOv3, SSD, MTCNN, and GoogLeNet
https://jkjung-avt.github.io/
MIT License
1.74k stars 545 forks source link

WARNING:root:Camera: starting while cap is not opened! ERROR: failed to open camera! #562

Closed Ardihermanto closed 2 years ago

Ardihermanto commented 2 years ago

Hello.. I want to ask about TensorRT Demos, when I ran the program with the RTSP link.. the output error was like the below..

WARNING:root:Camera: starting while cap is not opened! ERROR: failed to open camera!

Why the program error?

Thank you

jkjung-avt commented 2 years ago

Please refer to my blog post: How to Capture and Display Camera Video with Python on Jetson TX2

Make sure you've installed all necessary GStreamer components for RTSP.

ilhamrayhan117 commented 2 years ago

hello, i've run into the same problem while using the usb argument on trt_yolo, this is the command i'm using python3 trt_yolo.py --usb 0 -m yolov4_tsr_v1

and this is the output WARNING:root:Camera: starting while cap is not opened! ERROR: failed to open camera

please help, thank you

jkjung-avt commented 2 years ago

@ilhamrayhan117 Try setting USB_GSTREAMER to False to see if it works for you.

https://github.com/jkjung-avt/tensorrt_demos/blob/a061e44a82e1ca097f57e5a32f20daf5bebe7ade/utils/camera.py#L22

Ardihermanto commented 2 years ago

Please refer to my blog post: How to Capture and Display Camera Video with Python on Jetson TX2

Make sure you've installed all necessary GStreamer components for RTSP.

hello Jiun,

I have not found a solution for gstreamer rtsp

jkjung-avt commented 2 years ago

@Ardihermanto Please refer to https://github.com/jkjung-avt/tensorrt_demos/issues/220 to debug the issue. Basically you need to make sure you could access your RTSP stream by GStreamer first.

Ardihermanto commented 2 years ago

Thank you Jiun for your information