Vim3 npu demo can't open webcam

khadas@Khadas:~/aml_npu_demo_binaries/detect_demo$ ./detect_demo_x11_cv3 /dev/video0 3
W Detect_api:[det_set_log_level:19]Set log level=1
W Detect_api:[det_set_log_level:21]output_format not support Imperfect, default to DET_LOG_TERMINAL
W Detect_api:[det_set_log_level:26]Not exist VSI_NN_LOG_LEVEL, Setenv set_vsi_log_error_level
det_set_log_config Debug
det_set_model success!!

model.width:416
model.height:416
model.channel:3

capture device failed to open!

(detect_demo_x11_cv3:7097): GStreamer-CRITICAL **: 09:52:37.865: gst_element_get_state: assertion ‘GST_IS_ELEMENT (element)’ failed
thread_func exit

@llw555 Run this command ls /dev/video* , If you see vdeio0 and video1 , I think maybe video1 is you webcam .

2 Likes

video0 is my webcam, I can open it with Guvcview.
and I test video1 ,It not work.

@llw555 If it can be open with Gucview , it should can be open with npu demo to … Have you do any modified ? When you use npu demo , have any other program use this camera ?

No, Because the webcam cannot be open, I re-burned the firmware yesterday, and no other programs occupy the webcam. I downloaded the demo again.It still doesn’t work.

the demo of the picture can run normally.

What’s the resolution of your camera? Is it 1080P?

it’s only 720P,An ordinary webcam.

That’s the reason. The demo only support 1080P camera now. So you have to modify the code if you want to use a 720P camera.

1 Like

so is there any way we can run it with 720p webcam?

@Trong_Huu

E.g For UVC:

* Yoloface demo

$ ./detect_demo_xx_usb -d /dev/videoX -m 0 -w 1920 -h 1080

You can use -w and -h to change it to 720p.

1 Like

thanks for your help, i tried your way but its not working. However I fixed the max_height (720) and max_weight(1280) sections in the main.cpp file in the aml_npu_app section and luckily it worked.