ScreenRecorderLib.Levchenko 6.5.4

dotnet add package ScreenRecorderLib.Levchenko --version 6.5.4
                    
NuGet\Install-Package ScreenRecorderLib.Levchenko -Version 6.5.4
                    
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="ScreenRecorderLib.Levchenko" Version="6.5.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ScreenRecorderLib.Levchenko" Version="6.5.4" />
                    
Directory.Packages.props
<PackageReference Include="ScreenRecorderLib.Levchenko" />
                    
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 ScreenRecorderLib.Levchenko --version 6.5.4
                    
#r "nuget: ScreenRecorderLib.Levchenko, 6.5.4"
                    
#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 ScreenRecorderLib.Levchenko@6.5.4
                    
#: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=ScreenRecorderLib.Levchenko&version=6.5.4
                    
Install as a Cake Addin
#tool nuget:?package=ScreenRecorderLib.Levchenko&version=6.5.4
                    
Install as a Cake Tool

ScreenRecorderLib

A .NET library for screen recording in Windows, using native Microsoft Media Foundation for realtime encoding to h264 video or PNG images. This library requires Windows 8 or higher to function, as well as Visual C++ Redistributable x64 or x86 installed, depending on platform compiled for. This library also requires Media Foundation to work, which have to be installed from Server Manager if run on Windows Server, or from the respective "Media Feature Pack" if run on a Windows N or KN version.

Available on NuGet.

Basic usage:

This will start a video recording to a file, using the default settings:

        using ScreenRecorderLib;
        
        Recorder _rec;
        void CreateRecording()
        {
            string videoPath = Path.Combine(Path.GetTempPath(), "test.mp4");
            _rec = Recorder.CreateRecorder();
            _rec.OnRecordingComplete += Rec_OnRecordingComplete;
            _rec.OnRecordingFailed += Rec_OnRecordingFailed;
            _rec.OnStatusChanged += Rec_OnStatusChanged;
	    //Record to a file
	    string videoPath = Path.Combine(Path.GetTempPath(), "test.mp4");
            _rec.Record(videoPath);
        }
        void EndRecording()
        {
            _rec.Stop(); 
        }
        private void Rec_OnRecordingComplete(object sender, RecordingCompleteEventArgs e)
        {
	    //Get the file path if recorded to a file
            string path = e.FilePath;	
        }
        private void Rec_OnRecordingFailed(object sender, RecordingFailedEventArgs e)
        {
            string error = e.Error;
        }
        private void Rec_OnStatusChanged(object sender, RecordingStatusEventArgs e)
        {
            RecorderStatus status = e.Status;
        }

For more info and examples, see the quickstart guide, or check out the sample projects.

Donation

If this project is useful to you, please consider supporting the development with a donation 😃

paypal

Product Compatible and additional computed target framework versions.
.NET net8.0-windows10.0.19041 is compatible.  net9.0-windows 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.

This package has no dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on ScreenRecorderLib.Levchenko:

Package Downloads
Plugin.Maui.ScreenRecording

Plugin.Maui.ScreenRecording provides the ability to record the screen from within your .NET MAUI application

Plugin.Maui.ScreenRecording.Levchenko

Plugin.Maui.ScreenRecording provides the ability to record the screen from within your .NET MAUI application

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
6.5.4 193 4/26/2025
6.5.3 101 4/26/2025
6.5.1 102 4/26/2025

• Fixed bug where monitors with negative coordinates (to the left of main monitor) did not record properly.