Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Plugins

Georges Basile Stavracas Neto edited this page Oct 22, 2021 · 6 revisions

OBS Studio supports loading custom plugins that provide extra functionality to the application. Plugins can provide new source types, new filters, or enhance existing features of the application. There is a variety of plugins available for Windows, Mac, and Linux.

Installing Plugins

Using Flatpak, it is possible to install OBS Studio plugins using two different methods:

Method 1: Flatpak Extensions

This is the easiest and safest method to install plugins. Plugins distributed as Flatpak extensions on Flathub can easily be installed using your preferred app store, such as GNOME Software, KDE's Discover, or the elementary app store.

Method 2: Config Folder

The second way to install plugins is copying the shared library into the ~/.var/app/com.obsproject.Studio/config/obs-studio/plugins folder. This is less secure, doesn't handle sandboxing permissions, and may potentially lead to crashes. Use with caution.

Distributing Plugins on Flathub

OBS Studio plugins can be distributed on Flathub as Flatpak extensions. This is the preferred method of distributing plugins. By using Flatpak for distribution, plugins can request additional permissions and alter some aspects of the sandbox.

3 files are required to publish it on Flathub:

  1. The Flatpak manifest containing the sources and dependencies of your plugin. This file may be either YAML or JSON.
  2. AppStream metadata with useful information about your plugin, such as the name, a description, and the license.
  3. flathub.json with Flathub build options.

These files are described below. The input overlay plugin is an example of a plugin distributed on Flathub.

After creating each one of them, you can submit your plugin to Flathub by following the app submission guidelines.

1. Flatpak Manifest

This is the most relevant file as it describes how Flathub should build and publish your code. It is important to follow the following rules:

  • The plugin id must have com.obsproject.Studio.Plugin as the prefix (for example: com.obsproject.Studio.Plugin.MyShinyPlugin)
  • The installation prefix must be /app/plugins/<PluginName>, where <PluginName> is the last term of your plugin id. For example: /app/plugins/MyShinyPlugin where the plugin id is com.obsproject.Studio.Plugin.MyShinyPlugin
  • The plugin runtime must be com.obsproject.Studio

Here's an example of a plugin manifest:

id: com.obsproject.Studio.Plugin.MyShinyPlugin
branch: stable
runtime: com.obsproject.Studio
runtime-version: stable
sdk: org.kde.Sdk//5.15-21.08
build-extension: true
separate-locales: false
appstream-compose: false
build-options:
  prefix: /app/plugins/MyShinyPlugin
modules:
  - name: my-shiny-plugin
    buildsystem: meson
    post-install:
      - install -Dm644 --target-directory=${FLATPAK_DEST}/share/metainfo ${FLATPAK_ID}.metainfo.xml
      - appstream-compose --basename=${FLATPAK_ID} --prefix=${FLATPAK_DEST} --origin=flatpak ${FLATPAK_ID}
    sources:
      - type: git
        url: https://foo.bar/foobar/my-shiny-plugin.git
        commit: 9401942157397892354a65f75a6c82044a1cd25
      - type: file
        path: com.obsproject.Studio.Plugin.MyShinyPlugin.metainfo.xml

2. AppStream Metadata

This is a simple XML file containing information about your plugin. Here's an example:

<?xml version="1.0" encoding="UTF-8"?>
<component type="addon">
  <id>com.obsproject.Studio.Plugin.MyShinyPlugin</id>
  <extends>com.obsproject.Studio</extends>
  <name>My Shiny Plugin</name>
  <summary>Make OBS Studio shine with this plugin</summary>
  <url type="homepage">https://foo.bar/foobar/my-shiny-plugin</url>
  <metadata_license>CC0-1.0</metadata_license>
  <project_license>GPL-2.0</project_license>
</component>

3. flathub.json

Used to indicate which architectures the plugin should be built on. Usually it should look like this:

{
  "skip-icons-check": true,
  "only-arches": ["x86_64"]
}

Notice that OBS Studio is currently only available for x86_64 on Flathub.