VisioForge Video Capture SDK .Net — Cheat Sheet¶
Video Capture SDK .Net captures from webcams, IP cameras (RTSP/ONVIF), screens, Decklink, and GenICam/GigE Vision devices on all 5 .NET platforms (Windows, macOS, Linux, Android, iOS). VideoCaptureCoreX is the cross-platform engine; sources are configured via typed settings classes such as VideoCaptureDeviceSourceSettings, and devices are listed asynchronously with DeviceEnumerator.
AI coding agents: use the VisioForge MCP server
Building this with Claude Code, Cursor, or another AI coding agent? Connect to the public VisioForge MCP server at https://mcp.visioforge.com/mcp for structured API lookups, runnable code samples, and deployment guides — more accurate than grepping llms.txt. No authentication required.
Claude Code: claude mcp add --transport http visioforge-sdk https://mcp.visioforge.com/mcp
Platform support¶
- Windows x64 / x86 — WinForms, WPF, MAUI, Avalonia, Console. Full DirectShow sources + NVENC / AMF / Intel Quick Sync hardware encoding.
- macOS / macCatalyst — MAUI, Avalonia, Console. AVFoundation camera sources + VideoToolbox hardware encoding.
- Linux x64 — Avalonia, Console. V4L2 camera sources + NVENC / VA-API hardware encoding.
- Android — MAUI. Native camera sources + MediaCodec hardware encoding.
- iOS — MAUI. AVFoundation camera sources + VideoToolbox hardware encoding.
For the full codec × source × platform matrix see platform-matrix.md.
NuGet packages¶
Main SDK package (required, all platforms):
<PackageReference Include="VisioForge.DotNet.VideoCapture" Version="2026.*" />
Platform-specific native runtimes — add the ones you target:
<!-- Windows x64 -->
<PackageReference Include="VisioForge.CrossPlatform.Core.Windows.x64" Version="2025.11.0" />
<PackageReference Include="VisioForge.CrossPlatform.Libav.Windows.x64" Version="2025.11.0" />
<!-- Windows x86 -->
<PackageReference Include="VisioForge.CrossPlatform.Core.Windows.x86" Version="2025.11.0" />
<PackageReference Include="VisioForge.CrossPlatform.Libav.Windows.x86" Version="2025.11.0" />
<!-- macOS / macCatalyst -->
<PackageReference Include="VisioForge.CrossPlatform.Core.macOS" Version="2025.9.1" />
<PackageReference Include="VisioForge.CrossPlatform.Core.macCatalyst" Version="2025.2.15" />
<!-- Linux x64 -->
<PackageReference Include="VisioForge.CrossPlatform.Core.Linux.x64" Version="2025.11.0" />
<PackageReference Include="VisioForge.CrossPlatform.Libav.Linux.x64" Version="2025.11.0" />
<!-- Android / iOS -->
<PackageReference Include="VisioForge.CrossPlatform.Core.Android" Version="15.10.24" />
<PackageReference Include="VisioForge.CrossPlatform.Core.iOS" Version="2025.0.16" />
UI integration (pick the one that matches your UI stack):
<PackageReference Include="VisioForge.DotNet.Core.UI.MAUI" Version="2026.*" />
<PackageReference Include="VisioForge.DotNet.Core.UI.Avalonia" Version="2026.*" />
WinForms and WPF VideoView controls ship inside the main package. For the complete package list (including redistributables for the Windows-only VideoCaptureCore engine) see the Installation Guide.
Primary API classes¶
| Class | Role | See also |
|---|---|---|
VideoCaptureCoreX | Cross-platform capture engine — owns the pipeline, source, outputs, preview | Quick Start |
VideoCaptureDeviceSourceSettings | Configures a webcam / USB / DirectShow camera source | Enumerate and select device |
DeviceEnumerator | Async enumeration of video sources, audio sources, and audio outputs via DeviceEnumerator.Shared | Video sources overview |
VideoView | WinForms / WPF / MAUI / Avalonia preview control bound to the capture engine | Installation — video controls |
MP4Output | Muxes captured streams to .mp4 with H.264 / H.265 + AAC (GPU-accelerated when available) | Webcam → MP4 tutorial |
Additional source settings classes: RTSPSourceSettings (IP cameras — construct via RTSPSourceSettings.CreateAsync(uri, login, password, audioEnabled), not new), ScreenCaptureD3D11SourceSettings / ScreenCaptureGDISourceSettings / ScreenCaptureDX9SourceSettings (Windows screen), ScreenCaptureMacOSSourceSettings (macOS), ScreenCaptureXDisplaySourceSettings (Linux), DecklinkVideoSourceSettings, GenICamSourceSettings, NDISourceSettings.
Canonical minimum example¶
Record the first webcam + default microphone to recording.mp4:
using VisioForge.Core;
using VisioForge.Core.VideoCaptureX;
using VisioForge.Core.Types.X.Sources;
using VisioForge.Core.Types.X.Output;
// 1. Init SDK once at application startup.
await VisioForgeX.InitSDKAsync();
// 2. Enumerate connected devices (async — never block the UI thread).
var videoDevices = await DeviceEnumerator.Shared.VideoSourcesAsync();
var audioDevices = await DeviceEnumerator.Shared.AudioSourcesAsync();
if (videoDevices.Length == 0)
throw new InvalidOperationException("No video capture devices found.");
// 3. Create the capture engine, bound to a VideoView for live preview.
// Pass null instead of videoView for headless recording.
var capture = new VideoCaptureCoreX(videoView);
// 4. Configure video + audio sources.
capture.Video_Source = new VideoCaptureDeviceSourceSettings(videoDevices[0]);
capture.Audio_Source = audioDevices[0].CreateSourceSettingsVC();
capture.Audio_Record = true;
// 5. Add the MP4 output BEFORE calling StartAsync.
capture.Outputs_Add(new MP4Output("recording.mp4"));
// 6. Start capture — preview renders into videoView immediately.
await capture.StartAsync();
// ... later, when the user clicks Stop:
await capture.StopAsync(); // Finalizes and closes the MP4 file.
await capture.DisposeAsync(); // Releases the pipeline.
// 7. On application shutdown:
VisioForgeX.DestroySDK();
Swap VideoCaptureDeviceSourceSettings(...) for await RTSPSourceSettings.CreateAsync(new Uri("rtsp://..."), login, password, audioEnabled) for IP cameras, or new ScreenCaptureD3D11SourceSettings() for desktop recording (Windows) — the rest of the pipeline is identical.
Typical workflow¶
- Init —
await VisioForgeX.InitSDKAsync()(once per app). - Enumerate —
DeviceEnumerator.Shared.VideoSourcesAsync()/AudioSourcesAsync(). - Configure source — pick a settings class (
VideoCaptureDeviceSourceSettings,RTSPSourceSettings,ScreenCaptureD3D11SourceSettings/ScreenCaptureMacOSSourceSettings/ScreenCaptureXDisplaySourceSettings,DecklinkVideoSourceSettings, ...) and assign tocapture.Video_Source. - Create engine —
new VideoCaptureCoreX(videoView)for preview, ornew VideoCaptureCoreX(null)for headless. - Add outputs —
capture.Outputs_Add(new MP4Output(path)), orMKVOutput/WebMOutput/AVIOutput/RTMPOutput/HLSOutput. - Run —
StartAsync()→StopAsync()→DisposeAsync(), thenVisioForgeX.DestroySDK()on shutdown.
Common pitfalls¶
- Device enumeration is async. Always
await DeviceEnumerator.Shared.VideoSourcesAsync()— calling.Resultor.Wait()on the UI thread can deadlock. Audio uses its ownAudioSourcesAsync()/AudioOutputsAsync()calls; the video enumerator does not cover them. - Outputs must be added before
StartAsync.Outputs_Add(...)during an active capture is not supported — stop, add the output, and start again. - Virtual Camera needs extra registration. The
VirtualCameraredist package must be registered (see the deployment guide) before the virtual camera becomes visible to external applications like Zoom or Teams. - AnyCPU apps need both x86 and x64 redistributables. On Windows, ship both architectures or force a specific one via
<PlatformTarget>— partial deployment silently fails at source init time. - Mobile permissions must be granted before enumeration. On Android and iOS, camera and microphone permissions must be requested and granted before
DeviceEnumeratorruns — otherwise the returned list is empty. See the MAUI camera recording guide for per-platform permission setup.
See also¶
- Video sources
- Webcam / USB camera → Enumerate and select a device
- IP camera → RTSP, ONVIF, NDI
- Screen capture → screen.md
- Decklink / GenICam → decklink.md, USB3 Vision / GigE / GenICam
- Outputs & streaming
- MP4 recording → Webcam → MP4, IP camera → MP4
- Network streaming (RTMP / RTSP / HLS / SRT / NDI) → network-streaming
- Platform & deployment
- Windows / macOS / Ubuntu / Android / iOS → ../deployment-x/
- Install & target frameworks → ../install/index.md
- Full codec × source matrix → ../platform-matrix.md
- MAUI
- Cross-platform camera recording → MAUI camera recording
FAQ¶
How do I list connected cameras?¶
var cams = await DeviceEnumerator.Shared.VideoSourcesAsync(); — returns a list of VideoCaptureDeviceInfo with friendly names, supported formats, and frame rates.
Does this SDK support IP cameras?¶
Yes. Build settings via the async factory — await RTSPSourceSettings.CreateAsync(new Uri("rtsp://..."), login, password, audioEnabled) — and pass to VideoCaptureCoreX.Video_Source. The constructor is private, so new RTSPSourceSettings(...) will not compile. ONVIF and HTTP-JPEG cameras are also supported. See the IP camera brands directory for vendor-specific URLs.
What file formats can I record to?¶
MP4 (H.264 / H.265 + AAC), MKV, WebM (VP8 / VP9 / AV1 + Opus / Vorbis), AVI, GIF, plus live RTMP / RTSP / HLS / SRT / NDI streaming. See the output-format tables in the SDK overview.