Skip to main content
OBS Scripts

OBS Scripts #

Updated 2023-04-15

I spend a lot of time using OBS for streaming and for recording videos (or both at once). Since I like to tinker with things, I tinker with OBS to try and make it do things it was never meant to do. I actually got my start learning HTML and JavaScript by building files that could render in a browser source. It was easier than learning to write plug-ins, but it eventually ended up with OBS having to open several dozen chrome processes just to run all my browser sources, which almost turned my computer into a black hole.

I still haven’t gotten around to learning to write actual plugins for OBS, but OBS provides a system to run Python and Lua scripts that can provide a lot of power and even register custom filters. A lot of my early browser sources have been re-written as scripts over the years, often making them easier to use in addition to running better.

Below, I’ve linked some of the scripts that I judged useful or well-built enough to avoid embarrassment.

Mouse Control #

When solving a puzzle or planning out a difficult piece of platforming, I often stop and talk through my thought process. But I often find myself struggling if the game I’m playing does not have a mouse cursor or any other built-in way of gesturing at different level elements. So I built one. It’s a source that I can control using my mouse, even if my mouse is not visible in the game. If the game in question constrains the mouse, this won’t work, but that wasn’t a problem for the game I was playing when I made it. You can find the script here.

Limit with Scroll #

I was surprised there wasn’t an effect like this built into OBS. I’m slightly worried there’s something I’ve missed and someone is going to point it out and I’ll be very embarrassed. But until then, here’s a filter. I designed it for my Now Playing text when I’m streaming with a playlist going. The text updates automatically to show what’s playing, but some songs have long names, so it doesn’t always fit. This filter lets me place a limit on the text’s size. If it’s too long, it’ll get cropped and automatically scroll to make sure it can all be read. You can find the script here.

Sway #

I don’t think I’m actually using this one in my setup anywhere anymore. It simply makes a source sway back and forth. I used to use it to make background elements in my sidebar move very slowly (like five minutes to repeat). Sometimes I thought it was a nice effect. Sometimes I just couldn’t decide how to position things so I compromised by having them move and be certain they’ll be in the perfect spot twice every cycle. It does get jarring when editing videos, but I also realized that slowly moving things make the encoder freak out and waste a ton of bitrate trying to keep track of it. Either that, or the encoder ignores it completely and it jolts to a new position at every keyframe. It looks great in the OBS preview window, but it just wasn’t working on stream. You can find the script here.