NvEncSharp
A C# library for using nvidia hardware accelerated video encoding, decoding, and CUDA
Install / Use
/learn @jlennox/NvEncSharpREADME
About
NvEncSharp provides a dotnet core and .net framework interface to Nvidia's NvEnc hardware video encoder (nvEncodeAPI), the CUDA video decoder (nvcuvid), and the CUDA APIs (nvcuda).
The CUDA API implementation is version 10020. Most (but some) deprecated APIs are not included.
There's additional CUDA kernels for frame resizing and decoding inside LibCudaLibrary.
How to use
- Add the nuget package.
- Reference the encoder sample code: Capturing the screen as a video.
- Reference the decoder sample code: Decoding container-free h264 NAL packets to .bmp files and the screen.
Welcome contributions
Testing support for linux and x86 would be great. This has only been used and tested on 64bit Windows.
Large sections of the CUDA API have not been tested. There's likely transcription errors.
Maintaining forward compatibility with CUDA APIs.
Building
Sorry, this is way more a mess than it should be.
Note: The CUDA SDK is only needed for the sample projects. And is only needed for GPU based color space conversions.
- Install CUDA SDK 12.6, see notes below. CUDA SDK site.
- Select Visual Studio integration in the installer.
This originally targeted 10.2 CUDA SDK, and the API definitions still match that, but has been updated to target 12.6. I have not found a direct download link for 12.6.
The 12.6 documentation suggests the archived versions are now offered using conda but I have not tried this.
Updating the SDK version may be easier than finding the depricated version.
Updating/changing the CUDA SDK
- Modify
CUDA_VERSIONinsideNvEncSharp/src/NvEncSharp.Cuda.Library/NvEncSharp.Cuda.Library.propsto your target version. - If it compiles it compiles. If not, it's possible that the CUDA SDK has introduced breaking changes that need to be addressed.
Related Skills
qqbot-channel
351.8kQQ 频道管理技能。查询频道列表、子频道、成员、发帖、公告、日程等操作。使用 qqbot_channel_api 工具代理 QQ 开放平台 HTTP 接口,自动处理 Token 鉴权。当用户需要查看频道、管理子频道、查询成员、发布帖子/公告/日程时使用。
docs-writer
100.6k`docs-writer` skill instructions As an expert technical writer and editor for the Gemini CLI project, you produce accurate, clear, and consistent documentation. When asked to write, edit, or revie
model-usage
351.8kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
project-overview
FlightPHP Skeleton Project Instructions This document provides guidelines and best practices for structuring and developing a project using the FlightPHP framework. Instructions for AI Coding A
