Periphery.Camera 5.0.0

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

Periphery.Camera

Capture frames from a camera you chose by identity. Supports Windows (Media Foundation) and Linux (V4L2), not macOS.

dotnet add package Periphery.Camera --prerelease
using Periphery;
using Periphery.Camera;

var device = await Devices.Enumerate()
    .OfCategory(DeviceCategory.Camera)
    .WithUsbId("046D", "0825")
    .FirstOrDefaultAsync()
    ?? throw new InvalidOperationException("That camera is not attached.");

await using var session = await CameraSession.For(device)
    .PreferNv12()
    .MaxResolution(1280, 720)
    .OpenAsync();

await foreach (var frame in session.CaptureAsync())
{
    using (frame)
        Process(frame.ContiguousBuffer.Span);
}

Dispose every frame. Frames come from a fixed pool, and an undisposed frame is a buffer the pool never gets back.

Options

CameraSession.For(device).WithSessionOptions(o => o with { BufferCount = 6 })
Option Meaning Default
BufferCount Frames you may hold at once 3
QueueDepth Frames queued between capture and your loop 1
ExhaustionPolicy LatestWins drops the oldest queued frame when you fall behind; StallProducer waits for you LatestWins

session.Metrics.FramesDropped counts the frames a session drops.

To keep frames beyond the loop, or to feed several consumers from one camera, see Camera fan-out and retention.

Package What it adds
Periphery.Camera.Avalonia A CameraPreview control for Avalonia
Periphery.Camera.OpenCvSharp Frames as OpenCV Mats, without VideoCapture
Periphery.Camera.Testing A hardware-free camera backend for tests
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  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 is compatible.  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.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on Periphery.Camera:

Package Downloads
FrameFlow.Camera

FrameFlow — cross-platform FFmpeg media pipelines for .NET: decode, encode, play back, capture from cameras, and run inference on frames. UI-agnostic core

Periphery.Camera.OpenCvSharp

OpenCvSharp4 bindings for Periphery.Camera. AsMat() wraps a captured frame as a cv::Mat with no copy, ToMat() hands back an owned one, and ToBgr() converts any capture format to CV_8UC3 BGR — so an OpenCV pipeline can open a specific camera by identity instead of guessing at VideoCapture(0).

Periphery.Camera.Avalonia

Avalonia controls for Periphery.Camera. Drop CameraPreview into your XAML and bind it to a DeviceInfo to get a live camera feed with reconnect resilience and zero capture-loop plumbing. Renders BGRA32 and RGBA32 straight into a reused WriteableBitmap, decodes MJPEG through Skia, and converts YUY2 and NV12 in-process.

Periphery.Camera.Testing

Hardware-free test support for Periphery.Camera. Provides InMemoryCameraBackend (a scriptable, faultable fake capture backend) plus CameraTestScope and CameraTestHarness so consumers can unit-test code that wraps CameraSession/CameraDevice without a real camera.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
5.0.0 137 10/2/2026
4.3.0 151 9/23/2026
4.2.0 161 9/16/2026
4.2.0-alpha.1 104 9/9/2026
4.1.0-alpha.2 1,476 8/30/2026