This directory contains sample applications demonstrating ObsKit.NET usage.
Before running the samples, you must set up the OBS runtime in the sample's output directory.
- Run the setup script from the repository root:
Bash (Git Bash):
./tools/setup-obs-runtime.sh 32.0.4 ./obs-runtime- Copy the runtime to each sample's output directory:
# For Recording sample
Copy-Item -Recurse .\samples\obs-runtime\* .\samples\ObsKit.NET.Sample.Recording\bin\Debug\net10.0\
# For ReplayBuffer sample
Copy-Item -Recurse .\samples\obs-runtime\* .\samples\ObsKit.NET.Sample.ReplayBuffer\bin\Debug\net10.0\- Build and run:
cd samples\ObsKit.NET.Sample.Recording
dotnet runDemonstrates basic video recording:
- Initialize OBS in headless mode
- Create a scene with monitor capture
- Record to MP4 file with x264/AAC encoding
- Display recording statistics
Demonstrates replay buffer functionality:
- Initialize OBS in headless mode
- Create a scene with monitor capture
- Maintain a rolling 30-second buffer
- Save replays on demand
Each sample directory should look like this after setup:
ObsKit.NET.Sample.Recording/
├── bin/Debug/net10.0/
│ ├── ObsKit.NET.Sample.Recording.exe
│ ├── obs.dll
│ ├── obs-ffmpeg-mux.exe
│ ├── libobs-d3d11.dll
│ ├── ... (other OBS DLLs)
│ ├── data/
│ │ ├── libobs/
│ │ └── obs-plugins/
│ └── obs-plugins/
│ └── 64bit/
├── Program.cs
└── ObsKit.NET.Sample.Recording.csproj
"ERROR: OBS runtime not found!"
- The OBS runtime has not been copied to the output directory
- Run the setup script and copy files as described above
"Source ID 'monitor_capture' not found"
- The
win-capture.dllplugin is missing fromobs-plugins/64bit/
"Failed to start recording"
- Ensure
obs-ffmpeg-mux.exeis in the output directory - Check that you have write permissions for the output path
