MVSDK 2.4.1.7

dotnet add package MVSDK --version 2.4.1.7                
NuGet\Install-Package MVSDK -Version 2.4.1.7                
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="MVSDK" Version="2.4.1.7" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MVSDK --version 2.4.1.7                
#r "nuget: MVSDK, 2.4.1.7"                
#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.
// Install MVSDK as a Cake Addin
#addin nuget:?package=MVSDK&version=2.4.1.7

// Install MVSDK as a Cake Tool
#tool nuget:?package=MVSDK&version=2.4.1.7                

MVSDK C#

This is a C# wrapper for Huaray (iRAYPLE) MVSDK C library, similar to the provided MVSDK_Net.dll and MVSDKFG_Net.dll provided by iRAYPLE.

However this library have C structs processed into magaged class and structs for easier use.

Requirements

This is just a wrapper of the provided C library, you have to install MVViewer Client (or get the lib by other methods) before you can use this library.

Official MVViewer Client can be downloaded from Huaray (iRAYPLE) website, the latest version tested is v2.4.1 (2023-11-22).

Usage

Native Library Version

var version = HuarayLibrary.Version;

Enumerate devices

// scan from all interface types
DeviceEnumerator.Enumerate();
// scan only usb3 devices
DeviceEnumerator.Enumerate(InterfaceType.USB3);
// scan PCIe and GigE devices
DeviceEnumerator.Enumerate(InterfaceType.PCIe | InterfaceType.GigE);
// unicast scanning
DeviceEnumerator.Enumerate(IPAddress.Parse("192.168.1.10"));

Create and connect to the camera

var camera = new VideoCaptrue(IPAddress.Parse("192.168.1.10"));
// or
var camera = new VideoCapture("...", CreateHandleMode.ByCameraKey);
var camera = new VideoCapture("...", CreateHandleMode.ByUserDefinedName);
var camera = new VideoCapture(0); // by scan index, not recommanded.

// change the IP address of the camera (GigE) if required
//camera.ForceIP(...);

/* call open to actually connect to the camera */
camera.Open();

When creating the VideoCapture instance with CreateHandleMode other than ByScanIndex, the lib will scan for cameras with DeviceEnumerator.Enumerate(InterfaceType.All).

If you want to create the VideoCapture instance by index, do a scan first yourself, or StatusCode.InvalidResource because no camera information is in the native cache.

Streaming

// attach event handler
camera.FrameGrabbed += (sender, e) => 
{
    /* do something with the frame */
};

// start streaming
camera.StartGrabbing();

/* `camera.FrameGrabbed` event will be invoked. */

// stop streaming
camera.StopGrabbing();

Recording

// attach event handler
camera.FrameGrabbed += (sender, e) =>
{
    var camera = (VideoCapture)sender;
    camera.RecordFrame(e);
};

// prepare for recording
camera.StartRecording(...);
// start streaming
camera.StartGrabbing();

/* `camera.FrameGrabbed` event will be invoked. */

// stop streaming
camera.StopGrabbing();
// end recording
camera.StopRecording();

Clean-up

camera.Close(); // disconnect
camera.Dispose(); // don't forget to dispose native resources when you're done

TODO

  • more StandardFeatures, currently I just added the ones I use.
  • wrap IMV_FG_* for CameraLink devices

Disclaimer

The authohr of this software is not affiliated with Zhejiang Huaray (iRAYPLE) Cooperation in any way. All trademarks and registered trademarks are property of their respective owners, and company, product and service names mentioned in this readme or appearing in source code or other artifacts in this repository are used for identification purposes only.

Use of these names does not imply endorsement by either Zhejiang Huaray (iRAYPLE) Cooperation.

Reference

  1. https://github.com/harboleas/mvsdk_sharp
  2. https://www.emva.org/standards-technology/genicam/
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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. 
.NET Framework net481 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.4.1.7 242 2/5/2024
2.4.1.6 112 2/4/2024
2.4.1.5 111 2/4/2024
2.4.1.4 122 2/4/2024
2.4.1.2 97 2/3/2024
2.4.1.1 114 2/3/2024
2.4.1 141 2/3/2024