{
    "id": "com.obsproject.Studio",
    "runtime": "org.freedesktop.Platform",
    "runtime-version": "25.08",
    "sdk": "org.freedesktop.Sdk",
    "command": "obs",
    "finish-args": [
        "--socket=wayland",
        "--socket=fallback-x11",
        "--socket=pulseaudio",
        "--device=all",
        "--share=network",
        "--share=ipc",
        "--filesystem=xdg-run/pipewire-0",
        "--filesystem=host",
        "--talk-name=org.kde.StatusNotifierWatcher",
        "--talk-name=org.freedesktop.Flatpak",
        "--talk-name=org.freedesktop.Notifications",
        "--talk-name=org.a11y.Bus",
        "--env=VST_PATH=/app/extensions/Plugins/vst"
    ],
    "add-extensions": {
        "com.obsproject.Studio.Plugin": {
            "directory": "plugins",
            "subdirectories": true,
            "add-ld-path": "lib",
            "merge-dirs": "lib/obs-plugins;share/obs/obs-plugins",
            "no-autodownload": true,
            "autodelete": true
        },
        "org.freedesktop.LinuxAudio.Plugins": {
            "directory": "extensions/Plugins",
            "version": "25.08",
            "add-ld-path": "lib",
            "merge-dirs": "vst",
            "subdirectories": true,
            "no-autodownload": true
        }
    },
    "modules": [
        {
            "name": "obs-deps-buildstream-base",
            "buildsystem": "simple",
            "build-commands": [
                "tar -xvf base.tar.xz -C /"
            ],
            "sources": [
                {
                    "type": "file",
                    "dest-filename": "base.tar.xz",
                    "url": "https://github.com/obsproject/obs-deps-buildstream/releases/download/2026-07-15/flatpak-base-x86_64-2026-07-15.tar.xz",
                    "sha256": "396522a370529c31bbec6de810aff8bd5ba4eef103b2218954ffa5d8847dc943"
                }
            ]
        },
        {
            "name": "obs-deps-buildstream-devel",
            "buildsystem": "simple",
            "build-commands": [
                "tar -xvf devel.tar.xz -C /"
            ],
            "sources": [
                {
                    "type": "file",
                    "dest-filename": "devel.tar.xz",
                    "url": "https://github.com/obsproject/obs-deps-buildstream/releases/download/2026-07-15/flatpak-devel-x86_64-2026-07-15.tar.xz",
                    "sha256": "2499b622f450f3ae6ea7e9d893d8063cdacd8aa2089ecd4b8462d16e970fbc43"
                }
            ]
        },
        {
            "name": "obs-deps-buildstream-devtools",
            "buildsystem": "simple",
            "build-commands": [
                "tar -xvf devtools.tar.xz -C /"
            ],
            "cleanup": [
                "*"
            ],
            "sources": [
                {
                    "type": "file",
                    "dest-filename": "devtools.tar.xz",
                    "url": "https://github.com/obsproject/obs-deps-buildstream/releases/download/2026-07-15/flatpak-devtools-x86_64-2026-07-15.tar.xz",
                    "sha256": "557e5cf96a7118f1377b7eabe402621908f7ba6a9bc93fbb134ebc175d31a5d9"
                }
            ]
        },
        {
            "name": "obs-deps-buildstream-qt",
            "buildsystem": "simple",
            "build-commands": [
                "tar -xvf qt.tar.xz -C /"
            ],
            "sources": [
                {
                    "type": "file",
                    "dest-filename": "qt.tar.xz",
                    "url": "https://github.com/obsproject/obs-deps-buildstream/releases/download/2026-07-15/flatpak-qt-x86_64-2026-07-15.tar.xz",
                    "sha256": "231c5671173f7b6d33df457eb6991c5b6a76bccc59545b7e32d56f0e87b97872"
                }
            ]
        },
        {
            "name": "cef",
            "build-options": {
                "no-debuginfo": true
            },
            "buildsystem": "simple",
            "build-commands": [
                "mkdir -p /app/cef/libcef_dll_wrapper",
                "cp -R ./include /app/cef",
                "cp -R ./Release /app/cef",
                "cp -R ./Resources /app/cef",
                "cp -R ./build/libcef_dll_wrapper/libcef_dll_wrapper.a /app/cef/libcef_dll_wrapper"
            ],
            "cleanup": [
                "*"
            ],
            "sources": [
                {
                    "type": "archive",
                    "url": "https://cdn-fastly.obsproject.com/downloads/cef_binary_6533_linux_x86_64_v6.tar.xz",
                    "sha256": "7963335519a19ccdc5233f7334c5ab023026e2f3e9a0cc417007c09d86608146"
                }
            ]
        },
        {
            "name": "obs",
            "buildsystem": "cmake-ninja",
            "builddir": true,
            "config-opts": [
                "-DCMAKE_BUILD_TYPE=RelWithDebInfo",
                "-DENABLE_WAYLAND=ON",
                "-DENABLE_BROWSER=ON",
                "-DCEF_ROOT_DIR=/app/cef",
                "-DENABLE_ALSA=OFF",
                "-DENABLE_PULSEAUDIO=ON",
                "-DENABLE_JACK=ON",
                "-DENABLE_VLC=OFF",
                "-DENABLE_AJA=ON",
                "-DENABLE_LIBFDK=ON",
                "-DENABLE_QSV11=ON",
                "-DENABLE_DECKLINK=OFF"
            ],
            "secret-opts": [
                "-DRESTREAM_CLIENTID=$RESTREAM_CLIENTID",
                "-DRESTREAM_HASH=$RESTREAM_HASH",
                "-DTWITCH_CLIENTID=$TWITCH_CLIENTID",
                "-DTWITCH_HASH=$TWITCH_HASH",
                "-DYOUTUBE_CLIENTID=$YOUTUBE_CLIENTID",
                "-DYOUTUBE_CLIENTID_HASH=$YOUTUBE_CLIENTID_HASH",
                "-DYOUTUBE_SECRET=$YOUTUBE_SECRET",
                "-DYOUTUBE_SECRET_HASH=$YOUTUBE_SECRET_HASH"
            ],
            "post-install": [
                "install -d /app/plugins",
                "install -d /app/extensions/Plugins"
            ],
            "sources": [
                {
                    "type": "dir",
                    "path": "../"
                }
            ]
        }
    ]
}
