ObsKit.NET 0.0.11

There is a newer version of this package available.
See the version list below for details.
dotnet add package ObsKit.NET --version 0.0.11
                    
NuGet\Install-Package ObsKit.NET -Version 0.0.11
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ObsKit.NET" Version="0.0.11" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ObsKit.NET" Version="0.0.11" />
                    
Directory.Packages.props
<PackageReference Include="ObsKit.NET" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ObsKit.NET --version 0.0.11
                    
#r "nuget: ObsKit.NET, 0.0.11"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ObsKit.NET@0.0.11
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ObsKit.NET&version=0.0.11
                    
Install as a Cake Addin
#tool nuget:?package=ObsKit.NET&version=0.0.11
                    
Install as a Cake Tool

ObsKit.NET

A modern .NET 9 wrapper for OBS Studio, providing a fluent C# API for video recording, streaming, and replay buffer functionality.

Features

  • Cross-Platform - Windows, Linux, and macOS support
  • Fluent API - Clean, chainable configuration
  • Recording - Record video to MP4, MKV, FLV, and more
  • Replay Buffer - Keep a rolling buffer of the last N seconds
  • Sources - Monitor capture, window capture, game capture, images, media files
  • Encoders - x264, NVENC (H.264/HEVC), AAC audio
  • Headless Operation - Run without GUI dependencies

Requirements

Quick Start

using ObsKit.NET;
using ObsKit.NET.Outputs;
using ObsKit.NET.Sources;

var obsPath = AppContext.BaseDirectory;

// Initialize OBS
using var obs = Obs.Initialize(config => config
    .WithDataPath(Path.Combine(obsPath, "data", "libobs"))
    .WithModulePath(
        Path.Combine(obsPath, "obs-plugins", "64bit"),
        Path.Combine(obsPath, "data", "obs-plugins", "%module%"))
    .ForHeadlessOperation()
    .WithVideo(v => v.Resolution(1920, 1080).Fps(60))
    .WithAudio(a => a.WithSampleRate(48000)));

Console.WriteLine($"OBS {Obs.Version} initialized");

// Create a scene with monitor capture
using var scene = Obs.Scenes.Create("My Scene");
using var monitor = MonitorCapture.FromPrimary();
scene.AddSource(monitor);
scene.SetAsProgram();

// Set up and start recording
using var recording = new RecordingOutput("My Recording")
    .SetPath("output.mp4")
    .SetFormat(RecordingFormat.Mp4)
    .WithDefaultEncoders(videoBitrate: 6000, audioBitrate: 192);

recording.Start();
Console.WriteLine("Recording... Press any key to stop.");
Console.ReadKey();

recording.Stop();
Console.WriteLine($"Recorded {recording.TotalFrames} frames");

OBS Runtime Setup

ObsKit.NET requires OBS Studio binaries. Use the setup script to download them:

./tools/setup-obs-runtime.sh

The script will prompt you for version and platform. For manual setup, download OBS from GitHub Releases.

Windows Structure

YourApp/
├── YourApp.exe
├── obs.dll, obs-ffmpeg-mux.exe, *.dll  # From OBS bin/64bit/
├── data/
│   ├── libobs/                          # Shader files
│   └── obs-plugins/                     # Plugin data
└── obs-plugins/64bit/                   # Plugin DLLs

Linux Structure

YourApp/
├── YourApp
├── lib/libobs.so.0                      # OBS libraries
├── obs-plugins/                         # Plugin .so files
└── data/libobs/, obs-plugins/           # Data files

Run with: LD_LIBRARY_PATH="$PWD/lib" ./YourApp

macOS Structure

YourApp/
├── YourApp
└── OBS.app/Contents/
    ├── Frameworks/                      # OBS libraries
    ├── PlugIns/                         # Plugin .so files
    └── Resources/data/                  # Data files

Run with: DYLD_LIBRARY_PATH="$PWD/OBS.app/Contents/Frameworks" ./YourApp

Source Types

// Monitor capture
using var monitor = MonitorCapture.FromPrimary();
using var monitor = MonitorCapture.FromMonitor(1);

// Window capture
using var window = WindowCapture.FromWindow(WindowCapture.AvailableWindows[0]);

// Game capture (Windows only)
using var game = new GameCapture("Game", GameCapture.CaptureMode.AnyFullscreen);

// Image and media
using var image = ImageSource.FromFile("logo.png");
using var media = new MediaSource("Video", "video.mp4").SetLooping(true);

Encoders

// Video - x264 (CPU)
var encoder = VideoEncoder.CreateX264("Video", bitrate: 6000);

// Video - NVENC (NVIDIA GPU)
var encoder = VideoEncoder.CreateNvencH264("Video", bitrate: 6000);
var encoder = VideoEncoder.CreateNvencHevc("Video", bitrate: 6000);

// Audio - AAC
var encoder = AudioEncoder.CreateAac("Audio", bitrate: 192);

DPI Awareness (Windows)

When using DXGI Desktop Duplication for monitor capture on Windows, your application must be configured as per-monitor DPI aware.

For Windows Forms / WPF apps, add to your .csproj:

<PropertyGroup>
  <ApplicationHighDpiMode>PerMonitorV2</ApplicationHighDpiMode>
</PropertyGroup>

For console apps, add an app.manifest file:

<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
  <application xmlns="urn:schemas-microsoft-com:asm.v3">
    <windowsSettings>
      <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
      <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>
    </windowsSettings>
  </application>
</assembly>

And reference it in your .csproj:

<PropertyGroup>
  <ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>

Alternatively, use MonitorCaptureMethod.WindowsGraphicsCapture which doesn't require DPI awareness.

Troubleshooting

Problem Solution
"OBS runtime not found" Ensure obs.dll / libobs.so.0 / libobs.0.dylib is in the correct location
"Failed to find 'default.effect'" The data/libobs/ folder is missing
"Source ID 'xxx' not found" Required plugin not loaded
Recording fails Ensure obs-ffmpeg-mux.exe exists (Windows) and output path is writable
Module loading hangs Use .ForHeadlessOperation() to exclude GUI modules
DXGI DuplicateOutput1 DPI error See DPI Awareness section above

License

This project wraps OBS Studio which is licensed under GPLv2. See the OBS Studio license for details.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on ObsKit.NET:

Repository Stars
Segergren/Segra
Record and clip your games. Open-source, built on OBS. Replay buffer, clip editor and auto highlights for CS2, League, Dota 2 and more.
Version Downloads Last Updated
1.6.1 219 9/10/2026
1.6.0 158 9/4/2026
1.5.7 150 9/1/2026
1.5.6 104 9/1/2026
1.5.5 128 8/1/2026
1.5.4 224 8/1/2026
1.5.3 127 8/1/2026
1.5.2 135 7/22/2026
1.5.1 160 7/21/2026
1.5.0 151 7/18/2026
1.4.1 205 6/14/2026
1.4.0 128 6/14/2026
1.3.0 192 6/2/2026
1.2.1 271 5/15/2026
1.2.0 126 5/14/2026
1.1.0 286 4/25/2026
1.0.0 212 3/1/2026
0.0.13 144 2/3/2026
0.0.12 134 1/24/2026
0.0.11 146 1/24/2026
Loading failed