Releasing VideoCapture / Webcam doesn't work (Bug #3672)


Added by Martijn van der Veen almost 11 years ago. Updated over 9 years ago.


Status:Incomplete Start date:2014-05-02
Priority:Normal Due date:
Assignee:Maksim Shabunin % Done:

0%

Category:python bindings
Target version:3.0
Affected version:branch 'master' (3.0-dev) Operating System:Linux
Difficulty:Medium HW Platform:x64
Pull request:

Description

Using python (3.4) bindings on Ubuntu 14.04 with build-in webcam using v4l4, master branch:

In [2]: cap = cv2.VideoCapture(0)
HIGHGUI ERROR: V4L/V4L2: VIDIOC_S_CROP

In [3]: a,b = cap.read() # although error, reading frame works (a=True, b=np.array)

In [4]: cap.release()

In [5]: cap.isOpened()
Out5: False

In [6]: cap = cv2.VideoCapture(0)
HIGHGUI ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV

In [7]: a,b = cap.read()
VIDIOC_STREAMON: Bad file descriptor

After calling .release(), webcam light stays on and webcam stays unreachable for other programs (e.g., Cheese).


Associated revisions

Revision 8e1b1a84
Added by Vadim Pisarevsky about 10 years ago

Merge pull request #3672 from asmorkalov:debian_lower_case

History

Updated by Martijn van der Veen almost 11 years ago

(Btw, the webcam is released when python exits, but in some cases that's not enough - e.g., for running programs that need to release the webcam now and then.)

Updated by Alexander Smorkalov almost 11 years ago

  • Category set to python bindings

Updated by Andrew Senin almost 11 years ago

Hello Martijn,

Since our resources are limited please consider investigating this issue and creating a fixing pull request (http://code.opencv.org/projects/opencv/wiki/How_to_contribute). All help to the project is highly appreciated!

  • Status changed from New to Open
  • Assignee set to Martijn van der Veen
  • Difficulty set to Medium

Updated by Maksim Shabunin almost 10 years ago

  • Target version changed from 3.0-beta to 3.0

Updated by Maksim Shabunin almost 10 years ago

Can not reproduce with the 3.0-rc1 release. Webcam is successfully released and reopened.

Can you, please, try to reproduce it with the latest version? Probably it has been fixed already.

  • Assignee changed from Martijn van der Veen to Maksim Shabunin

Updated by Maksim Shabunin almost 10 years ago

  • Status changed from Open to Incomplete

Updated by Maksim Shabunin over 9 years ago

Issue has been transferred to GitHub: https://github.com/Itseez/opencv/issues/4739

Also available in: Atom PDF