# obs-filter-hotkeys



## upgradeQ (Oct 23, 2020)

upgradeQ submitted a new resource:

obs-filter-hotkeys - Filter hotkeys for OBS Studio



> Screenshots
> hotkeys
> 
> 
> ...



Read more about this resource...


----------



## upgradeQ (Oct 23, 2020)

Ideas page - https://ideas.obsproject.com/posts/67/allow-hotkeys-to-be-setup-for-filters
Related pulls :








						UI: Redesign hotkeys interface by cg2121 · Pull Request #2133 · obsproject/obs-studio
					

Description This overhauls the hotkeys interface with better organization with tabs and drop downs to select the scene, source, etc. Filter hotkeys have also been added.    Motivation and Context H...




					github.com
				











						Add RFC: Create new plugin type (control), and Re-implement hotkeys as a control plugin by cpyarger · Pull Request #28 · obsproject/rfcs
					

Summary  create new plugin type "control" Reimplement hotkeys as a control plugin  Motivation While currently we have the ability to control obs through plugins, There is no unified structure that ...




					github.com
				



Related forum topics:





						Hotkeys on Filters
					

It'd be nice if there could be hotkeys on filters as there are on sources. The use case for this is I often switch from a direct source with no delay, like a game emulator, to an actual console thru a capture card that has quite a delay. So, with the delay, I have to add a delay filter to many...




					obsproject.com
				








						OBS Studio audio source filter hotkey
					

I think it's very important feature - set the hotkey to trun on/off mic filter(s). Im a singer, and i want to turn on VST reverb when im singing, then turn down vst effect and speaking via hotkey.




					obsproject.com


----------



## upgradeQ (Nov 23, 2020)

upgradeQ updated obs-filter-hotkeys with a new update entry:

Add toggle filter visibility hotkey



> download here : https://github.com/upgradeQ/obs-filter-hotkeys/releases/tag/0.2.0



Read the rest of this update entry...


----------



## upgradeQ (Dec 23, 2020)

upgradeQ updated obs-filter-hotkeys with a new update entry:

Add hold feature



> Added hold feature so when you hold hotkey (pressed down for some period of time) filter is active, otherwise it's inactive.



Read the rest of this update entry...


----------



## THE R3Y3S (Dec 27, 2020)

HI, i start to use your script and i love it. Btw i add 3 same filter on one source but i can setup hotkeys only of first filter, not others of the same type


----------



## upgradeQ (Dec 28, 2020)

THE R3Y3S said:


> HI, i start to use your script and i love it. Btw i add 3 same filter on one source but i can setup hotkeys only of first filter, not others of the same type


What do you mean? Did you add additional filters after you've added "Filter hotkeys audio/video" type filter? If so - it will not register hotkeys right away, restart required.


----------



## upgradeQ (Jan 24, 2021)

upgradeQ updated obs-filter-hotkeys with a new update entry:

Version 1.0.0



> Changed hotkey registering logic. You also might want to check `obs-libre-macros` - Scripting and macros hotkeys in OBS Studio for Humans



Read the rest of this update entry...


----------



## RvNxMango (Jan 25, 2021)

Tried installing today and got the following error

[filter_hotkeys_audio.lua] Failed to call save for Filter hotkeys audio by upgradeQ: ...uments/obs-filter-hotkeys-1.0.0/filter_hotkeys_audio.lua:111: bad argument #1 to 'pairs' (table expected, got nil)

Any idea what's happening here? Would love to try the plug-in!


----------



## upgradeQ (Jan 25, 2021)

RvNxMango said:


> Tried installing today and got the following error
> 
> [filter_hotkeys_audio.lua] Failed to call save for Filter hotkeys audio by upgradeQ: ...uments/obs-filter-hotkeys-1.0.0/filter_hotkeys_audio.lua:111: bad argument #1 to 'pairs' (table expected, got nil)
> 
> Any idea what's happening here? Would love to try the plug-in!


What source do you attach Filter hotkeys to ? Can you please describe how it happens in steps , e.g:
1)Add script
2)Select source with N filters 
3)Right click add filters hotkeys 
...
You also might try previous versions


----------



## Lapppy (Jan 27, 2021)

I'm also having the same issue, but only with the newest version. 0.3.1 seems to work well!

```
[filter_hotkeys_audio.lua] Failed to call save for Filter hotkeys audio by upgradeQ: ...nloads/obs-filter-hotkeys-1.0.0/filter_hotkeys_audio.lua:111: bad argument #1 to 'pairs' (table expected, got nil)
```
I want to toggle a filter on my Microphone source, but it seems to happen on any audio source I try.
Steps for what I did below:

Add the script 
Open filter settings on any audio source (in this case, my mic source)
If there are no filters, add at least one
Add the "filter hotkeys audio" filter
Click Close
The script log window pops up with the error
Closing and reopening the filter settings prints a new line to the script log
No new hotkeys appear in the settings


----------



## upgradeQ (Jan 27, 2021)

upgradeQ updated obs-filter-hotkeys with a new update entry:

obs-filter-hotkeys 1.0.1



> Fix audio filters creation in microphone sources



Read the rest of this update entry...


----------



## OpenFields (Jan 27, 2021)

The download doesn't have an extension. It only  contains the  filename '1.0.1'.


----------



## Lapppy (Jan 28, 2021)

upgradeQ said:


> upgradeQ updated obs-filter-hotkeys with a new update entry:
> 
> obs-filter-hotkeys 1.0.1
> 
> ...


New version works! Thanks so much for this script, this functionality is something that should be added to OBS normally!


----------



## Randy Tian (Jan 29, 2021)

error near < , no working in obs 26.1.1


----------



## upgradeQ (Jan 29, 2021)

Randy Tian said:


> error near < , no working in obs 26.1.1


Could you upload a log file please ? Also make sure to run latest 1.0.1 version.


----------



## Randy Tian (Feb 3, 2021)

upgradeQ said:


> Could you upload a log file please ? Also make sure to run latest 1.0.1 version.



ok try this latest and working now , thanks a lot and appreciated very mush


----------



## thewitt (Feb 3, 2021)

Brilliant.  This needs to be core functionality.  So very useful if you are performing and want a compressor and reverb, but don't want that when you are just talking.

I've set all the effects on my mic to toggle off and on with the *same* hotkey, so one key turns them all off and back on again as I switch between singing and just talking with my viewers.

Brilliant


----------



## soulie (Feb 19, 2021)

Hiya, this seems to work well! Thank you for making this, it's great!

I'm having a bit of a problem though,  the audio script works fine by letting me toggle the filters but as soon as obs is restarted, the hot keys are no longer there. It's like it isn't saving the hot keys. Also, the video script is saving the hotkey fine.


----------



## upgradeQ (Feb 23, 2021)

@soulie please post a log file:





						Please post a log with your issue! Here's how...
					

OBS Studio creates a log file each time you run it which contains very useful diagnostic information. Without a log file, it's much harder for any support volunteers to figure out problems and your post may be ignored.  To upload a log file, go to the Help menu > Log Files > Upload Last Log...




					obsproject.com
				



I've tested it on GNU/Linux (Ubuntu 18.04) on microphone and media sources(with restart) - it works.


----------



## soulie (Feb 27, 2021)

upgradeQ said:


> @soulie please post a log file:
> 
> 
> 
> ...


Here's the log file from the first session where the hot keys were set and applied.


			https://obsproject.com/logs/Y-uN_C9mmTs71wp7
		


and a picture:




Here's the log file after loading up OBS again.


			https://obsproject.com/logs/I30gqwH6tVYuJtv0
		


and a picture:



Any ideas?


----------



## upgradeQ (Feb 27, 2021)

@soulie Second log did not finished to write data, there is no information about shutting down and there is no "Number of memory leaks" line, how did you close OBS ?

You might try using previous 0.3.1 version which has timeout based hotkey registering logic, however there were problems with it (OBS might not able to start and you must manually delete/rename `filter_hotkeys_audio.lua` file, if that happens)
Select this version on history page here:





						OBS Lua - obs-filter-hotkeys - History
					






					obsproject.com


----------



## soulie (Feb 28, 2021)

upgradeQ said:


> @soulie Second log did not finished to write data, there is no information about shutting down and there is no "Number of memory leaks" line, how did you close OBS ?
> 
> You might try using previous 0.3.1 version which has timeout based hotkey registering logic, however there were problems with it (OBS might not able to start and you must manually delete/rename `filter_hotkeys_audio.lua` file, if that happens)
> Select this version on history page here:
> ...


Thanks, man.

I uploaded the last log file (1) and the current log file (2) so that's why it wouldn't have shown the shutting down part on the 2nd log file. This time I have uploaded a log after shutting down on the 2nd session (when the hotkey bindings disappear).



			https://obsproject.com/logs/Lx2QxCz1YKCizd2b


----------



## upgradeQ (Mar 1, 2021)

Did the suggested method worked?

I think you have plugins which conflict with this script, try downloading clean OBS,restart PC then start obs64.exe directly


----------



## soulie (Mar 2, 2021)

upgradeQ said:


> Did the suggested method worked?
> 
> I think you have plugins which conflict with this script, try downloading clean OBS,restart PC then start obs64.exe directly


Thanks, I will have a go!


----------



## soulie (Mar 25, 2021)

upgradeQ said:


> Did the suggested method worked?
> 
> I think you have plugins which conflict with this script, try downloading clean OBS,restart PC then start obs64.exe directly



OK, so I was able to reproduce the problem on my laptop with a fresh install of OBS. The problem is the script won't work with filters on global audio sources in the Audio Mixer dock.

@upgradeQ Do you think it's possible to get the script working with the global audio sources?


----------



## upgradeQ (Mar 27, 2021)

upgradeQ updated obs-filter-hotkeys with a new update entry:

Change loading method to support Global audio sources



> @soulie Yes, it's possible, here is download link
> Did you know that you can put all audio in one scene and then add it to scenes via nested scene ?



Read the rest of this update entry...


----------



## soulie (Mar 30, 2021)

upgradeQ said:


> @soulie Yes, it's possible, here is download link
> Did you know that you can put all audio in one scene and then add it to scenes via nested scene ?



Awesome, it works great now! Thank you very much, this will save so much time!

I didn't know about the nested scenes, cheers. I will take a look.


----------



## TrapperSevenFour (May 19, 2021)

This script is really useful for so many things, thanks for creating it.

I have a game with some info that I would like to hide using the toggle function, but the game does not actually remove the information until the second key press is _released_. Do you know if it is possible to do something like this with obslua? The first hotkey press toggles a filter on when it is pressed and the second hotkey press toggles it off when it is released?

I started learning Lua to see if I can understand it, but this is my first programming language so it is taking some time.


----------



## StrackDrackSDW (May 20, 2021)

Hi! I love this plugin! However, I have a question; Is it possible to do a reverse hold? 3 is hold down a key so it goes from OFF to ON and back to OFF when released, but is it possible to hold ON to OFF? It goes back to ON when key is released.
Thanks again for an awesome plugin!


----------



## upgradeQ (Jun 6, 2021)

TrapperSevenFour said:


> This script is really useful for so many things, thanks for creating it.
> 
> I have a game with some info that I would like to hide using the toggle function, but the game does not actually remove the information until the second key press is _released_. Do you know if it is possible to do something like this with obslua? The first hotkey press toggles a filter on when it is pressed and the second hotkey press toggles it off when it is released?
> 
> I started learning Lua to see if I can understand it, but this is my first programming language so it is taking some time.


On first hotkey press set to true, on second hotkey press do not set to false while holding, set to false when it is up.
Is that correct ? If so, it should be possible.


StrackDrackSDW said:


> Hi! I love this plugin! However, I have a question; Is it possible to do a reverse hold? 3 is hold down a key so it goes from OFF to ON and back to OFF when released, but is it possible to hold ON to OFF? It goes back to ON when key is released.
> Thanks again for an awesome plugin!


Yes, edit script in this place


----------



## nerd_hunt (Sep 11, 2021)

Hey, I followed your advice and changed the true and false statements on the code as you showed the previous user, and now this script almost works flawlessly; the only problem I have is the release of the key immediately removes the filter, quicker than the map on the game, showing a glimpse of the map.

I've scoured the internet and have found no viable solutions to this, how can I add a wait of a half second or a second to this script after releasing the key?

I know where to add the code to the script, but lua has no native sleep function and everything I seem to try gives me script error as I've never attempted to use LUA before; are there any workarounds for a slight delay that wont have extreme cpu usage?


----------



## awpp (Oct 12, 2021)

Hiya! Excited to try this but at the moment when I add it as a filter it says "No properties available."
Any way I can get to the settings? (I have already added a filter before it and tried restarting OBS - also I'm using Global audio sources).


----------



## awpp (Oct 12, 2021)

awpp said:


> Hiya! Excited to try this but at the moment when I add it as a filter it says "No properties available."
> Any way I can get to the settings? (I have already added a filter before it and tried restarting OBS - also I'm using Global audio sources).


NEVERMIND - Think I got it working now, I went to the Hotkey settings in OBS and found the options from your Script there near the top. Seems to be working thanks!


----------



## maxotics (Oct 31, 2021)

Great stuff! THANKS!!! I just used it to turn "Background Remover" on/off because I can't make it scene/group specific (maybe I'm missing something).  Either way, I can see myself using this a ton now!!!


----------



## I3ordo (Nov 28, 2021)

i tried it and i liked it ! i did not have to unzip the script into the obs, and put it wherever i chose.
 one improvement can be... on the clutter part... i think it could do less clutter on the hotkeys section by having its own section, like 4 entries per filter can create some huge clutter


----------



## SAngeli (Dec 18, 2021)

Hi,
I just learned about this lovely script to add to OBS. I wish to ask a question as I noted something strange: I do not know if I am doing something wrong.

_As for install, I copy those two .lua files in C:\Program Files\obs-studio\data\obs-plugins\frontend-tools\scripts
Then, I add them via Tools/Scripts to OBS._

I noticed that when I create a new Sources and add this new script, after removing the source in OBS Settings - Hotkeys I am still able to find trace of the scene with the filters. Is this normal? Should OBS as soon as the sources is deleted remote it from hotkey listing?
So far, it takes two OBS restarts in order to remove it from Settings – Hotkeys listing. Should it not be in real time?


----------



## SAngeli (Dec 19, 2021)

Moreover, I wish to understand why I am unable to assign the same key for 0 and 1 meaning for loading and unloading the filter.
I am able to so in withing OBS.


----------



## Teacher Faris (Jan 9, 2022)

Hi. New user here. I browsed through the web but haven't found the solution to my problem.

I have four filters here. However, when I want to assign hotkeys, I can only find Female and Tiny. The search didn't find the Robot and Giant. I tried restarting OBS but no dice.


----------



## ZLawhead (Jan 18, 2022)

This script is AMAZING! Thank you for making it! I can't believe that OBS has not had an official release with this function built in. This is a great feature! I only have two critiques...

1 - Why oh WHYYYY does it clear the hotkeys upon restart? I'm sure there's a reason, but I would LOVE to know if there is something (even quirky or complicated) that I can do on my end to preserve the keys until an actual fix is released. For my application of this super helpful script, it is going to be really annoying and tedious to re-add the hotkeys each time the program is launched. I have a total of 8 hotkeys to type in (disable [0] and enable [1] options for 4 different visual filters on a single source - programmed with a multi-action on a stream deck).

2 - The random order that the 0,1,2,3 options for the source(s) show up in the hotkey menu is a little annoying, but I think I'm only annoyed by it because of the first issue I mentioned.

[The second critique matters very little in comparison to the first. I just wanted to offer thorough feedback.]


----------



## ZLawhead (Jan 18, 2022)

ZLawhead said:


> This script is AMAZING! Thank you for making it! I can't believe that OBS has not had an official release with this function built in. This is a great feature! I only have two critiques...
> 
> 1 - Why oh WHYYYY does it clear the hotkeys upon restart? I'm sure there's a reason, but I would LOVE to know if there is something (even quirky or complicated) that I can do on my end to preserve the keys until an actual fix is released. For my application of this super helpful script, it is going to be really annoying and tedious to re-add the hotkeys each time the program is launched. I have a total of 8 hotkeys to type in (disable [0] and enable [1] options for 4 different visual filters on a single source - programmed with a multi-action on a stream deck).
> 
> ...


Adding onto this to say that I noticed the hotkeys do occasionally 'stick'/persist through restarting OBS. However, I can't produce that result consistently enough to prove that when they do reset it is anything other than random. Maybe you have more info/insight? Looking forwarding to a response!


----------



## upgradeQ (Jan 23, 2022)

SAngeli said:


> Hi,
> I just learned about this lovely script to add to OBS. I wish to ask a question as I noted something strange: I do not know if I am doing something wrong.
> 
> _As for install, I copy those two .lua files in C:\Program Files\obs-studio\data\obs-plugins\frontend-tools\scripts
> ...


Yes, code to clean afterwards is not written, though Pull Requests are welcome. Also I recommend to avoid default script's location and put 3rd party scripts elsewhere, because if you want to reinstall OBS Studio later it clears that folder.


SAngeli said:


> Moreover, I wish to understand why I am unable to assign the same key for 0 and 1 meaning for loading and unloading the filter.
> I am able to so in withing OBS.


Scripting API currently does  not provide means to do 1 to 1 copy of app functionality, use hotkeys with prefix 2 for that. 



Teacher Faris said:


> Hi. New user here. I browsed through the web but haven't found the solution to my problem.
> 
> I have four filters here. However, when I want to assign hotkeys, I can only find Female and Tiny. The search didn't find the Robot and Giant. I tried restarting OBS but no dice.
> 
> View attachment 78898 View attachment 78899


Try using 0.3.1 version and increase timeout (ms) value here in your version if necessarily.
Also please provide a log
Please post a log with your issue! Here's how... | OBS Forums (obsproject.com) 
It might be desync when you load some heavy VST plugin.


ZLawhead said:


> This script is AMAZING! Thank you for making it! I can't believe that OBS has not had an official release with this function built in. This is a great feature! I only have two critiques...
> 
> 1 - Why oh WHYYYY does it clear the hotkeys upon restart? I'm sure there's a reason, but I would LOVE to know if there is something (even quirky or complicated) that I can do on my end to preserve the keys until an actual fix is released. For my application of this super helpful script, it is going to be really annoying and tedious to re-add the hotkeys each time the program is launched. I have a total of 8 hotkeys to type in (disable [0] and enable [1] options for 4 different visual filters on a single source - programmed with a multi-action on a stream deck).
> 
> ...





ZLawhead said:


> Adding onto this to say that I noticed the hotkeys do occasionally 'stick'/persist through restarting OBS. However, I can't produce that result consistently enough to prove that when they do reset it is anything other than random. Maybe you have more info/insight? Looking forwarding to a response!


1 - Please post a log with your issue! Here's how... | OBS Forums (obsproject.com) , also it's been almost a year with no updates on my side, maybe something changed in OBS Studio, you might try to downgrade your current version if applicable. 
2 - This is all what Scripting API provides for hotkey registration, it might be possible to use another method via FFI, but that might introduce regressions... so I would rather stick to current implementation.


----------



## Iplay4u (Jan 29, 2022)

upgradeQ said:


> Try using 0.3.1 version and increase timeout (ms) value here in your version if necessarily.
> Also please provide a log
> Please post a log with your issue! Here's how... | OBS Forums (obsproject.com)
> It might be desync when you load some heavy VST plugin.


Hey! Having this same issue but the 0.3.1 release hasn't fixed it. Not sure how to change the delay as I have no apps that can open .lua files. As for help, here is my log: https://obsproject.com/logs/pigAF4BV8Do84C23


----------



## upgradeQ (Jan 29, 2022)

Iplay4u said:


> Hey! Having this same issue but the 0.3.1 release hasn't fixed it. Not sure how to change the delay as I have no apps that can open .lua files. As for help, here is my log: https://obsproject.com/logs/pigAF4BV8Do84C23


Analyzer | OBS (obsproject.com) - it says that you did not run under admin, this may interfere with hotkeys not working in fullscreen apps on Microsoft Windows, also you did not do important step of streaming/recording test session. Logs also missing "_filter_hotkeys_audio/video" ids, not sure why. You can open and edit .lua files with an text editor try Visual Studio Code or Neovim.


----------



## Peach4Hour (Sunday at 10:01 AM)

Any updates ? This script doesn't work in obs v29, but works perfectly in obs v29 beta 3


----------



## upgradeQ (Monday at 8:44 PM)

Peach4Hour said:


> Any updates ? This script doesn't work in obs v29, but works perfectly in obs v29 beta 3


You should provide logs. It works on my machine version 29.0.0 Windows 11, earlier in this thread there was information about 0.3.1 release, this also might help you.


----------



## Peach4Hour (Today at 6:50 PM)

upgradeQ said:


> You should provide logs. It works on my machine version 29.0.0 Windows 11, earlier in this thread there was information about 0.3.1 release, this also might help you.


donno how, but, can confirm, working just fine now :)


----------

