obsproject / obs-studio

OBS Studio - Free and open source software for live streaming and screen recording
https://obsproject.com
GNU General Public License v2.0
60.24k stars 7.98k forks source link

Video Capture Device (V4L2) properties reset camera settings #3092

Closed ifohancroft closed 3 weeks ago

ifohancroft commented 4 years ago

Platform

Operating system and version: Manjaro Linux OBS Studio version: 25.0.7-194-g05c9ddd2 (Installed from AUR but I've modified the PKGBUILD file to build the latest version from the Master Branch)

Expected Behavior

  1. I configure my camera outside of OBS (V4L2 Test Bench (Qt V4L2 Test Utility from package v4l-utils)) (Things like brightness, contrast, white balance, focus) and I close the Test Bench.
  2. I open OBS and I either add my camera using the Video Capture Device (V4L2) source or open its properties if the source is already added.
  3. If I hit Cancel (regardless of whether I changed any options) OR If I hit OK (without changing any options) OR if I hit OK but have changed only some options - Nothing should be changed or reset to default except the options I have changed.

Current Behavior

  1. I configure my camera outside of OBS (V4L2 Test Bench (Qt V4L2 Test Utility from package v4l-utils)) (Things like brightness, contrast, white balance, focus) and I close the Test Bench.
  2. I open OBS and I either add my camera using the Video Capture Device (V4L2) source or open the properties of an already added source. Either way, I find myself at the Video Capture Device (V4L2) properties dialog
  3. Regardless of whether I hit Cancel or OK and whether I've changed no options or just some, all settings of the camera below the Use Buffering options get reset. To further clarify: If you change some options and hit OK, those will be saved but the rest will be reset, even if they have previously been persistently set to something else outside of OBS.

The V4L2 Test Bench settings are usually persistens (unless OBS resets them or you reset them explicitly), not only between runs, when opening it again also, as well as between restarts and even different Operating Systems.

Steps to Reproduce

  1. Configure your webcam outside of OBS using the V4L2 Test Bench and close it
  2. Open OBS and add the camera or open its properties if already added
  3. Hit Cancel or change 1+ options below the Use Buffering option but not all and hit OK.
  4. All settings below the Use Buffering option are reset. (I mean the one you set will sit at what you set, I think).
kkartaltepe commented 4 years ago

I would say that this bug report is backwards. The claim is that settings outside OBS should take precedent over OBS, but probably instead OBS should never display with settings conflicting to what you've set.

E.g. In OBS if you set your brightness to max it is quite bright. Following repro, close obs, set brightness to 0 in qv4l2, restart obs, and see that the external settings have taken affect (Id think my OBS settings should have taken affect at this point).

The fact that my settings dont take affect until entering settings seems like the bug.

It seems worth considering changing the functionality to not saving your settings for these v4l2 settings but I think thats a bit odd since the rest of OBS settings are saved. (Maybe it would be possible to allow all settings to have a default somehow that lets it default to whatever mode/value the device happened to be in, similar to the requested functionality).

ifohancroft commented 4 years ago

My point was that once I change the settings via the V4L2 Test Bench, then I go to OBS, if I don't change the settings in OBS, the settings should remain the way they are set, however, OBS resets those settings on closing the Properties dialog even if you close it by hitting Cancel without changing anything in there.

I'd say it's not about settings from one software taking precedence over another, but you can change the settings from multiple places (V4L2 Test Bench and OBS) and when you set the settings from one, the other shouldn't reset the settings just because you've opened and closed the Properties window even though you haven't changed anything or resetting all settings if you have just changed one option.

thadeupenna commented 4 years ago

It seems to be a V4L2 feature since configurations through v4l2ctl are not persistent as described in ArchWiki

ifohancroft commented 4 years ago

It seems to be a V4L2 feature since configurations through v4l2ctl are not persistent as described in ArchWiki

I haven't tested unplugging and plugging back the web camera. persistency in the context of this ticket is meant as explained in the ticket (remaining after closing the software, remaining after reboot, remaining after booting into another OS, etc)

thadeupenna commented 4 years ago

My camera has a led and I noticed that if a close qtv4l2 and open OBS, the led flashes. So, I suspect the module is unloaded and loaded again by OBS, losing the changes I have made. According to ArchWiki, the changes in qtv4l2 are always temporary. To make it permanent (or persistent),they have to be done with udev rules.

ifohancroft commented 4 years ago

My camera has a led and I noticed that if a close qtv4l2 and open OBS, the led flashes. So, I suspect the module is unloaded and loaded again by OBS, losing the changes I have made. According to ArchWiki, the changes in qtv4l2 are always temporary. To make it permanent (or persistent),they have to be done with udev rules.

That seems to be true, however, the bug report is about the fact that as soon as you close the properties of the camera in OBS, even if you haven't changed anything and just hit Cancel/Close, OBS resets all the camera settings when it shouldn't also if you change just some settings and hit Ok (or even Cancel/Close) it applies everything, not just the settings you have changed, thus, setting the options you have changed, to the new value and resetting everything else, when it shouldn't do that.

EduardoRFS commented 4 years ago

It's worse, if you change something outside of obs even with OBS open, you can see the change, but in the instant that you click in the camera on the scene or in the source list it will reset. Try running something like the following with OBS opened, so no the module isn't reloading

v4l2-ctl --set-ctrl=white_balance_temperature_auto=1
Staacks commented 3 years ago

Would like to add my perspective too, which is also more or less the inverse of OP.

I use multiple cameras with HDMI grabbers via V4L. These grabbers start with an unnaturally high saturation, which I reset to normal levels in OBS. However, if I restart everything the OBS the settings are not applied and I need to manually open the settings for each grabber to apply these settings (I do not have to change any setting - cancelling is sufficient as OP describes).

In my opinion, the most versatile solution would be an option in the V4L plugin to reapply the settings when the V4L device is (re)opened.

Fenrirthviti commented 3 weeks ago

Closing as stale. If this is still an issue please open a new issue with updated reproduction steps on the latest version of OBS.