Obs-studio: [BUG] Video Capture Device (V4L2) is not released when hidden

Created on 22 Apr 2020  路  6Comments  路  Source: obsproject/obs-studio

Platform

Operating system and version: Ubuntu 19.10 - eoan
OBS Studio version: 25.0.7 (64 bit), installed via sudo snap install obs-studio

Expected Behavior

When I press the eye symbol next to the source "Video Capture Device (V4L2)". I expect that my webcam switches of and that I can use it in another program. In windows there is an option to switch the webcam off when hidden, in the properties of the webcam source.

Current Behavior

When I press the eye symbol next to the source "Video Capture Device (V4L2)", my webcam stays on and other programs that tries to access it, is giving an error.
This can be fixed by deleting the whole source in OBS-studio, but that means I need to add it every time I want to use it again.

Steps to Reproduce

  1. Add your webcam to sources with "Video Capture Device (V4L2)"
  2. Hide it by clicking on eye symbol next to it
  3. Open another program that can access your webcam (I use Cheese on Ubuntu)
  4. The program errors that it can't access the device
  5. After deleting the "Video Capture Device (V4L2)" in OBS, the webcam will be accessible in another program

Additional information

A use-case for releasing the "Video Capture Device (V4L2)" is that sometimes I record a desktop session while I display my webcam through OBS. Another time I record a desktop session while my webcam is used by another program. Every time I switch, I need to delete the "Video Capture Device (V4L2)" source or add it again. Deleting isn't that much of a hassle, but setting it up again, in the right position, with an overlay and mask etc, etc. That is some work. It would be cool if there is the same option as in windows, to switch-off/release the webcam when the source is hidden.

By Design / Not a bug Linux

Most helpful comment

@kkartaltepe In the windows version of OBS there is an option in the "Video Capture Device" to shutdown the webcam when the source is hidden. I would be great to also have this in Linux. There is now no way to switch off your camera in OBS for Linux other then to delete the source.

All 6 comments

Another rationale is that when in use, the camera reserves USB bus bandwidth which is not released. So when having three cameras it may be possible to use only 2 simultaneously. When the cameras are still in capture mode even when hidden, it is impossible to switch to two other cameras that way (workaround would be to make scenes, but there are other bugs).

This is by design, initializing a camera is a slow process so the camera is kept available for scene switches or when you unhide it. This also prevents other processes from stealing the camera when you might be in another scene and not expect it.

Not to say that your use case is not valid, but that is why it's this way.

@kkartaltepe In the windows version of OBS there is an option in the "Video Capture Device" to shutdown the webcam when the source is hidden. I would be great to also have this in Linux. There is now no way to switch off your camera in OBS for Linux other then to delete the source.

I don't know how it is on windows, but undoubtedly it would not be desirable to have diverging functionality across platforms.

@kkartaltepe I still would like to see the same option as there is in windows. That there's an option to shutdown the webcam when it source is hidden. Can this issue change to an Enhancement or should I create a new issue for this feature request?

Nvm, there is already some ongoing work for this. :tada: https://github.com/obsproject/obs-studio/pull/3159

Was this page helpful?
0 / 5 - 0 ratings