bitfocus / companion-module-obs-studio

OBS Studio Module for Companion
MIT License
45 stars 28 forks source link

feature-request: filter-control with relative values #159

Closed pflonk closed 1 year ago

pflonk commented 2 years ago

Hey there! I am trying to control OBS filter values with companion and set relative values to be applied on top of the ones, that already are set.

In particular i am talking about the "Color Grading" filter from the StreamFX filtercollection. Color grading is a common practice in broadcast environments and is in professional applications done by a dedicated technician, controlling the aperture and the color settings of the camera while using an oscilloscope and waveforms to determine technical correct exposure and color space values. In this case a camera control unit is used with a controller that has handles for any setting. The "Color Grading" filter kind of adds that functionality to OBS, but controlling it without hardware is a bit a pain in the you-know-what, so that's why I tried to control it via custom commands.

Setting absolute values is working fine, but that's not how that kind of filter works in a live environment. What I truly need is the possibility to set relative values in steps that I can determine in companion. In the case of this particular filter steps of 1% would be great which would be represented by a float value of 1.0

With custom commands I cannot combine GetFilterSettings with a calculation to add +1 to the value that is already set, so this seems to have be implemented as a new action for the websockets API.

The actual feature-request therefore is a new action to control any filter value with absolute values as well as with relative values. I think this would enhance the user experience of many companion-users that want to control an OBS environment greatly!

Kind regards! pflonk

Fred-DTV commented 2 years ago

you can do this with the amazing move value plugin from exeldro :)

pflonk commented 2 years ago

the plugin you suggested is indeed very nice, but i cannot trigger it multiple times to increase the value even further. it's just easing the value change over time. what I am planning to do is making a bunch of buttons to add / substract 1% to a specific value every time i press it

bryce-seifert commented 2 years ago

Looking into this, one of the main issues is there is such an expansive library of OBS filter plugins, all with very different settings. So creating a drop-in solution for this would require quite a bit of work. I'm not writing it off completely, just going to take a while to research more.

However, I was able to devise a way to do this with custom variables and the Custom Command in the OBS module. Basically, you can

  1. Create a custom variable for a filter setting
  2. Use the "Modify Variable Value with Math Operation" to modify the value
  3. Put the variable in the Custom Command

The drawbacks are this is very manual and labor intensive, and it doesn't return the value from OBS so unless you hit reset the variable in Companion likely won't equal the OBS value. I've attached some examples below in case you're curious in this workaround

Screen Shot 2022-08-28 at 7 14 15 PM Screen Shot 2022-08-28 at 7 13 53 PM Screen Shot 2022-08-28 at 7 14 12 PM

https://user-images.githubusercontent.com/50299051/187101062-7c632455-cdf5-4753-897e-d880fc0bf356.mov

pflonk commented 2 years ago

Hey Bryce,

thank you for your efforts! The workaround with the custom variables is of course a time consuming one (in my case I'd need to set up probably 75 variables or so), but would still help for the project I am working towards. However I was not able to reproduce the usage of custom variables within custom OBS commands. When sending a custom command with a fixed float value like say 15.0, the button sets the value (so custom commands basically work). Using the $(internal:custom_VariableName) instead does not work. I have tried with different filters without success.

{ "sourceName": "SourceName", "filterName": "Color Grading", "filterSettings": { "Filter.ColorGrade.Lift.Red": $(internal:custom_RedLift) } }

Watching your video also shows me that the change of values is represented instantly also within the GUI of the filter. This never happens in my case, even if the custom command worked.

I am using Windows for both companion and OBS, could there be a platform specific reason for this to not work?

OBS version 27.2.4 (64bit) companion [2.3.0 (2.3.0+4608-v2-3.0-2994a6d0)]

bryce-seifert commented 2 years ago

I think the issue here is that the public 2.3.0 release does not have the updated version of the module that allows you to use variables in the Custom Command.

In order to use that, you would need to use a beta build of Companion. Note, this would also require updating to obs-websocket 5.0

pflonk commented 2 years ago

Yay, thanks for that tip. Got the companion beta version that contains the last OBS change and installed websocket 5.1 Now this works fine. 🥳 I have to configure 75 custom variables now and control them via 225 buttons 😅 but hey! It's going to work. I will keep track of this issue and looking forward for any news regarding a new feature. Thanks for your time and work!

bryce-seifert commented 1 year ago

After some consideration, I'm going to table this issue for now, as I think having to build this within the current companion infrastructure for the wide variety of OBS filters is not within the scope of this module.