0

I have a raspberry Pi 4 and I am using a arducam camera along with open Cv it was working fine until now and suddenly is shows error "code

[WARN:0] global/tmp/pip-wheel-w_lllcn3/opencv-python_622962b8a47a42ed9a5e55c557dab@ed/opencv/modules/video10/src/cap v41.cpp (893) open VIDEOIO (V4L2:/dev/video0): can't open camera by index"

Everything is same i haven't changed the code, even the example code stoped working.

I tried

Import cv2

cap = cv2.VideoCapture(-1)

while True:

  success, frame = cap.read()

  cv2.imshow('win', frame)

  cv2.waitKey(1)

I also tried:

cv2.VideoCapture(0,cv2.CAP_DSHOW)
cv2.VideoCapture(index, cv2.CAP_V4L)

But nothing works

Error message:

[ WARN:0] global/tmp/pip-wheel-w_lllcn3/opencv-python_622962b8a47a42ed9a5e55c557dab@ed/opencv/modules/videoio/src/cap v41.cpp (893) open VIDEOID (V4L2:/dev/video0): can't open camera by index
9
  • Can you please correct the formatting of the code? Also, which error message are you getting?
    – Tino D
    Commented May 6 at 14:19
  • @TinoD i changed the formatting and added the error Commented May 6 at 14:27
  • try some of the suggestions here
    – Tino D
    Commented May 6 at 14:34
  • those devices only work with libcamera/libcamera2. they refuse to use standard V4L/V4L2 APIs. you can replicate the issue with any other program that would try to use V4L2, such as ffmpeg, VLC, guvcview... Commented May 6 at 14:37
  • @TinoD i tried it i got a list of 4 indexes that opened but none of them worked they gave timeout error Commented May 6 at 15:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.