QSoft.MediaCapture
1.0.0.8
dotnet add package QSoft.MediaCapture --version 1.0.0.8
NuGet\Install-Package QSoft.MediaCapture -Version 1.0.0.8
<PackageReference Include="QSoft.MediaCapture" Version="1.0.0.8" />
<PackageVersion Include="QSoft.MediaCapture" Version="1.0.0.8" />
<PackageReference Include="QSoft.MediaCapture" />
paket add QSoft.MediaCapture --version 1.0.0.8
#r "nuget: QSoft.MediaCapture, 1.0.0.8"
#addin nuget:?package=QSoft.MediaCapture&version=1.0.0.8
#tool nuget:?package=QSoft.MediaCapture&version=1.0.0.8
Important hint
if submodule Direct or DirectCore show new version, please don't update
Quick start
Create from symbolLink
var allcameras = QSoft.DevCon.DevConExtension.KSCATEGORY_VIDEO_CAMERA.DevicesFromInterface()
.Select(x => new
{
symbollink = x.DevicePath(),
panel = x.As().Panel()
});
var firstcamera = allcameras.FirstOrDefault();
if(firstcamera is null) return;
var camera = WebCam_MF.CreateFromSymbollink(firstcamera.symbollink);
await camera.InitCaptureEngine(new WebCam_MF_Setting()
{
IsMirror = firstcamera.panel==CameraPanel.Front
});
await camera.StartPreview(host.Child.Handle);
Init and start preview
var camera = QSoft.MediaCapture.WebCam_MF.GetAllWebCams()
.Find(x => x.FriendName == "USB2.0 HD UVC WebCam");
if(camera != null)
{
await camera.InitCaptureEngine();
await camera.SetPreviewSize(x => x.FirstOrDefault(y=>y.Width>=640));
await camera.StartPreview(host.Child.Handle);
}
Preview for WPF
var camera = QSoft.MediaCapture.WebCam_MF.GetAllWebCams()
.Find(x => x.FriendName == "USB2.0 HD UVC WebCam");
if(camera != null)
{
await camera.InitCaptureEngine();
await camera.SetPreviewSize(x => x.FirstOrDefault(y=>y.Width>=640));
await camera.StartPreview(bmp=>this.image.Source = bmp);
}
Take photo
support format
- jpg
- png
- bmp
- tif,tiff
var camera = QSoft.MediaCapture.WebCam_MF.GetAllWebCams()
.Find(x => x.FriendName == "USB2.0 HD UVC WebCam");
if(camera != null)
{
await camera.TakePhtot("123.jpg");
}
Record
Support format:
- mp4
- video: h264
- audio: aac
- wmv
- video: h264
- audio: aac
var camera = QSoft.MediaCapture.WebCam_MF.GetAllWebCams()
.Find(x => x.FriendName == "USB2.0 HD UVC WebCam");
if(camera != null)
{
await camera.StartRecord("123.mp4");
await Task.Delay(5000);
await camera.StopRecord();
}
WhiteBalance contorl
first check this device support this function after Init camera success
if (camera.WhiteBalanceControl.IsSupport)
{
//can set predefined value
camera.WhiteBalanceControl.Preset = ColorTemperaturePreset.Auto;
}
Flash
first check this device support this function after Init camera success
if(camera.FlashLight?.IsSupported)
{
//Flash support function
var supportfunc = camera.FlashLight.SupportStates;
//below usually use state if camera supports flashlight
camera.FlashLight.SetState(FlashState.OFF);
camera.FlashLight.SetState(FlashState.ON);
camera.FlashLight.SetState(FlashState.AUTO);
}
Torch
first check this device support this function after Init camera success
if(camera.TorchLight?.IsSupported)
{
//Flash support function
var supportfunc = camera.TorchLight.SupportStates;
//below usually use state if camera supports torch light
camera.TorchLight.SetState(FlashState.OFF);
camera.TorchLight.SetState(FlashState.ON);
}
EyeGazeCorrection
first check this device support this function after Init camera success
if(camera.EyeGazeCorrection?.IsSupported)
{
//Flash support function
var supportfunc = camera.TorchLight.SupportStates;
//below usually use state if camera supports torch light
camera.EyeGazeCorrection.SetState(EyeGazeCorrectionState.OFF);
camera.EyeGazeCorrection.SetState(EyeGazeCorrectionState.ON);
}
BackgroundSegmentation
first check this device support this function after Init camera success
if(camera.BackgroundSegmentation?.IsSupported)
{
//Flash support function
var supportfunc = camera.TorchLight.SupportStates;
//below usually use state if camera supports torch light
camera.BackgroundSegmentation.SetState(BackgroundSegmentationState.OFF);
camera.BackgroundSegmentation.SetState(BackgroundSegmentationState.Blur);
}
DigitalWindow
first check this device support this function after Init camera success
if(camera.DigitalWindow?.IsSupported)
{
//Flash support function
var supportfunc = camera.TorchLight.SupportStates;
//below usually use state if camera supports torch light
camera.DigitalWindow.SetState(DigitalWindowState.Manual);
camera.DigitalWindow.SetState(DigitalWindowState.AutoFaceFraming);
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0-windows7.0 is compatible. net7.0-windows was computed. net8.0-windows was computed. net8.0-windows7.0 is compatible. net9.0-windows was computed. net10.0-windows was computed. |
.NET Framework | net46 is compatible. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. net48 was computed. net481 was computed. |
-
.NETFramework 4.6
- DirectN (>= 1.17.2)
- System.ValueTuple (>= 4.5.0)
-
.NETFramework 4.7.2
- DirectN (>= 1.17.2)
-
net6.0-windows7.0
- DirectNCore (>= 1.17.2)
-
net8.0-windows7.0
- DirectNCore (>= 1.17.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
1. new BackgroundSegmentation function
2. new DigitalWindow function
3. new EyeGazeCorrection function
4. modify wpf preview distacher
5. remove whitebalance control
6. new AMCameraControl list
7. new AMVideoProcAmp list