{
    "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-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-01-09/flatpak-base-x86_64-2026-01-09.tar.xz",
                    "sha256": "664ff7c2e3cfa552a6b16e7b78428c1940a5a42f85911b5e4d57a053f0dcc9e1"
                }
            ]
        },
        {
            "name": "obs-deps-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-01-09/flatpak-devel-x86_64-2026-01-09.tar.xz",
                    "sha256": "214a18feff6d7e1ed5b42820ac806eafec50029e41f03c197f76e06eafb591dc"
                }
            ]
        },
        {
            "name": "obs-deps-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-01-09/flatpak-devtools-x86_64-2026-01-09.tar.xz",
                    "sha256": "f3381b9661925a593ebe42dded1a87f86d54e49c7fde92567f2f19d37564bb61"
                }
            ]
        },
        {
            "name": "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-01-09/flatpak-qt-x86_64-2026-01-09.tar.xz",
                    "sha256": "57c5c90cd5824d2a634ba92a0a2ad1b1a57347ee14a9eae41cf77c74970cee11"
                }
            ]
        },
        {
            "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": "../"
                }
            ]
        }
    ]
}
