1

I am only doing a simple code in my Raspberry Pi 4:

from imutils.video import VideoStream

# initialize the video streams and allow them to warmup
print("[INFO] starting cameras...")
webcam = VideoStream(src=0).start()

I can run this code without any problem with raspberry pi camera but get error with my Logitech C310 webcam.

The error is: VIDIOC_QBUF: Invalid argument

The camera works perfectly when used with fswebcam in the terminal. I also tried using it with online webcam test, and it works. My only problem is, the camera can't be used with my python code. I also tried using it with opencv and it return None.

Hardware: Raspberry Pi 4 4GB

OS: Raspbian Buster

Hope anyone can help, thank you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.