1

I do have an inbuiltwebcam in my laptop, but I ve bought one Logitech c270 for my college project purpose. Everytime I m trying to open my externally added webcam, it starts the inbuilt webcam. How to enable my external webcam in my laptop having ubuntu 18.04?? plse help

2
  • 1
    What does "trying to open ... webcam" mean? What program are you using? – waltinator Jan 28 '20 at 16:59
  • 1
    I m trying to access the external wbcam using python openCV,.Webcam working properly with cheese but not creating frames in opencv – Swapnadeep Sarkar Jan 28 '20 at 19:00
0

It depends on your program.

I am like cheese f.ex. just install with:
sudo apt install cheese

Than take a look how it works with:
cheese --help
[...]
-d, --device=DEVICE Device to use as a camera
[...]

(--help or -h should work with any program. If you're in any GUI search for 'Help' in the menu bar)

All possible devices can be seen with ls -ltrh /dev/video* and it starts with 0 (your internal cam). The external cam should be available with:
cheese -d /dev/video1 (of course depending on the other system configurations)

  • If this is too much, just disable the internal cam in your Laptop BIOS (the steps depends on your device).
  • If you'd like to have a cool solution, may you'd like to write an udev-rule for the permanent reorder.
  • Something in between is to find and unload the kernel driver ... but this needs to have two different camera chips/drivers. And when you'll start to write in /etc/modprobe.d/ (for example in blacklist), it could be easier for us to support the udev-thing.
3
  • with cheese its working fine, Thanks for that.. Now I m trying to cv2.VideoCapture(1) with open cv to capture the video frames, it says it cant open camera with index 1...Later I checked the devide id,as 825, and used cv2.VideoCapture(825)..The error message doesnt say now it cant open cam with that index but instead it says it couldnot create any frames – Swapnadeep Sarkar Jan 28 '20 at 18:50
  • I have no access to a OpenCV system right now. But I suggest you should add this in formation in the tags of this question and show us all the related code (better a little snipplet) and the exact output. So anybody can reproduce this behavior. – LupusE Jan 30 '20 at 9:52
  • Shouldn't it be cv2.VideoCapture(0)? – Hilman Apr 3 '20 at 5:28

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.