Select video renderer (WinForms)
Products: Video Capture SDK .Net, Video Edit SDK .Net, Media Player SDK .Net
You can use three different filters to render video - Video Renderer (legacy), Video Mixing Renderer 9, and Enhanced Video Renderer (in Windows Vista and later).
"VideoRenderer" value uses GDI for drawing. It does not use hardware acceleration and can be used only for compatibility purposes if DirectX 9 or later is not installed.
Sample code
VideoCapture1.Video_Renderer.VideoRenderer = VideoRendererMode.EVR;
Video Mixing Renderer 9 is an up-to-date filter that is recommended for use. It can use all of your video card's capabilities, such as hardware acceleration, while displaying and deinterlacing the image.
VideoCapture1.Video_Renderer.VideoRenderer = VideoRendererMode.VMR9;
Use the following code to get the list of available deinterlacing modes:
VideoCapture1.Video_Renderer_Deinterlace_Modes_Fill();
foreach (string deinterlaceMode in VideoCapture1.Video_Renderer_Deinterlace_Modes())
{
cbDeinterlaceModes.Items.Add(deinterlaceMode);
}
Enhanced Video Renderer is a new filter that is available in Windows Vista and later. It can use additional video acceleration features and is recommended to be used if available.
VideoCapture1.Video_Renderer.VideoRenderer = VideoRendererMode.EVR;
When the image is being displayed, the aspect ratio of the source video may not correspond to the size of the screen used for display.
Use the following code to stretch the image:
VideoCapture1.Video_Renderer.StretchMode = VideoRendererStretchMode.Stretch;
VideoCapture1.Video_Renderer_Update();
Use the following code to use black borders instead of stretching (letterbox):
VideoCapture1.Video_Renderer.StretchMode = VideoRendererStretchMode.Letterbox;
VideoCapture1.Video_Renderer_Update();
Required redists
- SDK redist
Visit our GitHub page to get more code samples.