# How to create OBS Studio plugins



## E.K.G (Aug 22, 2016)

Is there any instruction or tutorial for developing OBS Studio plugins(NOT OBS Classic)?


----------



## Jim (Aug 25, 2016)

Not yet.  Basically it all comes down to what you want to make.

Here's a very brief rundown of how to make a plugin:

1.) Everything for making plugins is in libobs/obs-module.h.  obs-module.h include all the other necessary plugin-related headers.  You include obs-module.h in your plugin where ever you need, and then use the provided macros within to define it.  A brief example is in the top comment of obs-module.h.  You use OBS_DECLARE_MODULE() to declare the module and all necessary functions, and obs_module_load function to define the initialization function and use it to register obs objects, such as sources/outputs/etc.  obs_register_source for example.  You only use those once of course.  All necessary OBS functions are in obs-module.h and obs.h.

2.) If for example you want to make a video/audio input source, take a look at libobs/obs-source.h to see the structure used for registering a source, the 'obs_source_info' structure.
For outputs, libobs/obs-output.h.  For encoders, libobs/obs-encoder.h.

3.) Create functions to define that structure, then register that structure with obs_register_*.

Outside of docs, distribution is the only other issue at the moment.  There's a plugin manager planned though it's been continually floating at "some time in the next two or three patches" for a while now, which means it's sort of medium-high priority but not highest priority yet.  The only way to get a third-party plugin working is by manually copying it in to the plugins/data dirs, similar to obs1, which sucks.  So instead I'm more aggressively merging new good plugins so we can work around the issue until the plugin manager actually is put in.

As for examples of how to create plugins, every core source/output/etc is already done via plugins, so there are examples of how to make functioning plugins in the plugins subdir.  They are all exactly how you would make plugins.

Now, if you're making a UI-based plugin or a plugin that controls UI, adds UI, or receives user interface callbacks (for things like automatic scene switchers, OBS Remote, etc), that's coming soon, needs a special API for controlling/monitoring the UI.  0.16.0 is when that's planned, next patch as of this writing.


----------



## E.K.G (Aug 26, 2016)

Very useful info. Thanks.
Look forward to the 0.16.0 build.


----------



## Vouk (Mar 28, 2017)

I recently wrote a custom encoder, but i noticed everything around the muxers / recording formats seems to be hardcoded. Will there be a plugin interface too? I'd like to add some non-h264 lossless recording functionality.


----------



## ek926m (Jun 7, 2017)

I have to develop an obs studio plugin now. I still can't find docs or advanced tutorials. Anything changed?


----------



## Osiris (Jun 7, 2017)

At the moment, the source is the documentation. Look at other plugins how they do things.


----------



## ek926m (Jun 27, 2017)

Osiris said:


> At the moment, the source is the documentation. Look at other plugins how they do things.



Could you link some easy example plugins? I have to start basically from scratch. :o


----------



## AwesomePaperWork (Feb 28, 2018)

In the plugin code, are you able to tell OBS to stream to your youtube channel?


----------



## Marcedo (Mar 8, 2018)

maybe you just could to use the python/lua script interface - looking at the scripts section may be a good start.


----------



## Saantiago Barreiro (May 6, 2018)

I am most interested in a tablet surface remote control, the interface in a computer is kind of hard
I do VB and XOJO programming


----------



## wondible (May 6, 2018)

Saantiago Barreiro said:


> I am most interested in a tablet surface remote control, the interface in a computer is kind of hard
> I do VB and XOJO programming


Sound more appropriate for the OBS Websockets plugins; there are already few remote controls for it.


----------



## MacTartan (May 9, 2018)

+1 for checking out scripting.  It's possible to create stuff pretty quickly to your own specification.  Looks like the team has put some serious effort into the documentation - there's a lot of good reading in there.


----------

