Skip to content

VidGrabWPF:VideoGrabberWPF component

The VidGrabWPF namespace of the .NET assembly includes 2 WPF components, compatible with the code of the VidGrab::VideoGrabber component of WinForms.

VideoGrabberWPF: video window

TVideoGrabber renders in a DirectShow renderer through a WindowsFormsHost.

This saves CPU, but with the potential "airspace issue" when WPF semi-transparent overlays are used.

The 4K / 8K video clips are played in NV12, as with the WinForms component; see 4K and 8K playback.

VideoGrabber2ImgWPF: Image component

TVideoGrabber renders through an Image component, which allows WPF semi-transparent overlays.

The Direct3DPresentation property (enabled by default from .NET 4.5) presents the videos of 3840 x 2160 and more, decoded in NV12, through Direct3D (D3DImage), without RGB conversion on the CPU. When it is disabled (or before .NET 4.5), all the frames are converted to RGB and copied into a WriteableBitmap.

Sample code

The sample code can be found in the "MainDemoWPF" project included in the package, under CSharp_VB.NET\DEMOS\C#\MainDemoWPF. This WPF demo project is similar to the WinForms MainDemo project.