0

Trying to access webcam (video 0) using opencv, python and I get the following error:

cap = cv2.VideoCapture(0)
pos_frame = cap.get(cv2.CAP_PROP_POS_FRAMES)

I0626 11:31:59.156796 18887 net.cpp:744] Ignoring source layer silence_rpn_bbox_pred
VIDEOIO ERROR: V4L2: getting property #1 is not supported
VIDEOIO ERROR: V4L2: getting property #1 is not supported -1.0 frames
VIDEOIO ERROR: V4L2: getting property #1 is not supported
VIDEOIO ERROR: V4L2: getting property #7 is not supported

Any leads will be appreciated

9000
  • 39,899
  • 9
  • 66
  • 104
Priya Narayanan
  • 1,197
  • 2
  • 10
  • 16
  • What is your OS? Assuming it's Linux, can you make your camera work when you run `gstreamer-configure` or a video capturing app like Cheese? – 9000 Jun 26 '17 at 17:36
  • Not all the `VideoCapture` backends support all the properties. Looking at [the](https://github.com/opencv/opencv/blob/master/modules/videoio/src/cap_v4l.cpp#L1618) [source](https://github.com/opencv/opencv/blob/master/modules/videoio/src/cap_v4l.cpp#L1593), it seems that the error message aren't lying. – Dan Mašek Jun 26 '17 at 18:53
  • Using Ubuntu. I am trying to interface it with Deep Learning algorithm with python script. – Priya Narayanan Jun 26 '17 at 19:39
  • Can you actually get images? It's not like getting frame position is a necessity when you retrieve individual frames from a webcam on demand. – Dan Mašek Jun 26 '17 at 19:43
  • Just the first frame – Priya Narayanan Jun 27 '17 at 12:06
  • Have you tried other indices ? cv2.VideoCapture(1) for instance – Saransh Kejriwal Jul 03 '17 at 04:41
  • Thanks . The frame position was giving me the error which I did not really need. I removed it and it is working fine now. – Priya Narayanan Jul 05 '17 at 19:49

0 Answers0