C++ program based on libobs (from obs-studio), designed to read RTMP streams and compose them as sources in different scenes.
The main part consists of a gRPC server. An example client is also provided.
This project uses Docker to ease build and deployment. If you follow the prerequisites below, accessing the GPU with Docker should work out of the box.
make
, docker
and docker compose
installed.sudo ubuntu-drivers install
. More info: https://ubuntu.com/server/docs/nvidia-drivers-installationnvidia-smi
works. If not, you might need to disable Secure Boot in your BIOS.Check which CUDA version is installed on your host using nvidia-smi
. If needed, edit Dockerfile
to use the same version as a base image: FROM nvidia/cudagl:<YOUR CUDA VERSION HERE>-devel-ubuntu24.04
Existing tags: https://hub.docker.com/r/nvidia/cudagl/tags
You can generate video sources to use as inputs (you only need to do this once):
make generate
You can also use live sources, check out STREAMING.md for details.
Copy the distributed env file end edit it as needed:
cp .env.dist .env
Build and run the server:
make build
make up
Start the client in an other terminal:
make client
Play the output stream:
make play
From the client, you can switch the source using by pressing s
and Enter
.
In order to allow the container to use the host's X Server, the xhost +
command is run when using make up/make server/make dev
.
The effect of this command persists after running the container, you can undo this by executing xhost -
on your host machine.
Input: edit etc/shows/default.json
to set the default scene when starting obs-headless. It contains two RTMP sources as inputs, for which you must set the URL of public or local RTMP streams (see STREAMING.md).
Output: edit config.txt
to set server
and key
with your output stream URL and key. You can stream to any platform supporting RTMP (Twitch, Youtube, ...). You can also use any local RTMP server (see STREAMING.md).
The build system uses three images:
Using the dev image: you can start a container with obs-headless sources attached as volumes, so you can edit sources and rebuild in the container.
make testsrc
.make dev
.rb
and start with st
(see etc/bashrc for aliases).Using the base image, you can also build obs-studio from sources.
OBS_SRC_PATH_DEV
in your .env file to the path where you just cloned obs-studiomake builder
.rb
and start with st
(see etc/bashrc for aliases). ============ LEGACY BUILD SYSTEM IS DEPRECATED ============
You are using the legacy build system to build OBS Studio. The legacy
build system is unsupported and will be removed in the near future.
To migrate to the new build system, familiarize yourself with CMake presets
(https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html) and
create a user preset with your customized build settings, inheriting from
one of the default presets.
============ LEGACY BUILD SYSTEM IS DEPRECATED ============
find_libobs_data_file()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -Wall -Werror -Wno-long-long -pedantic")