There are two scripts included in this repo, shitrate.py
and shitrate-peaks.py
.
- shitrate.py will decrease the bitrate directly according to volume levels.
- shitrate-peaks.py will decrease the bitrate according to jumps in average volume.
Whichever one you choose is based on personal preference and the effect you are going for. Peaks allows for a more watchable experience while decreasing the bitrate during loud moments for comedic effect while shitrate tends to be more purely chaotic but more accurate to what this project is intended to be.
- Open OBS, go to Tools > Scripting
- Make sure you have the install path to Python 3.6 correctly listed under Python Settings
- Add the script using the "+" icon.
- Add all audio sources you want the script to pull volume levels from.
- Begin recording / streaming! The script automatically enables.
- Make sure all sources added are audio sources. The script lists all sources at a time, however only audio sources (the ones listed under the Audio Mixer tab in OBS) will correctly give volume data.
- Set the maximum bitrate higher than you normally would (~1000+ kbps).
- To minimize how much background noise or generally low noises effect the output bitrate, try increasing the dampening. The minimum dampening value gives a straight linear relationship between volume levels and the bitrate while higher dampening causes volume to follow a concave down quadratic relationship to the bitrate.
- The default dampening and bitrate values are what I personally found working following OBS' audio mixer guide.
- Have fun 🙂
To the OBS Community Discord especially @/penwywern for their help. This code was largely based on upgradeQ's Access source dB volume level example in their OBS Studio Python Scripting Cheatsheet