Skip to main content

Code sample - Select video renderer

Sample code for Delphi and C# (ActiveX).

You can use 3 different filters to render video – Video Renderer, Video Mixing Renderer 9, and Enhanced Video Renderer (Windows Vista / 7).

Video Renderer uses GDI for drawing. It does not use hardware acceleration and can only be used for compatibility purposes and if Direct3D acceleration is unavailable.

VideoCapture1.Video_Renderer := VR_VideoRenderer;
VideoCapture1.Video_Renderer = VisioForge_Video_Capture_5.TxVFVideoRenderer.VR_VideoRenderer;

Video Mixing Renderer 9 is an up-to-date filter recommended for use. It can use all capabilities of your video card, such as hardware acceleration while displaying and deinterlacing the image.

VideoCapture1.Video_Renderer := VR_VMR9;
VideoCapture1.Video_Renderer = VisioForge_Video_Capture_5.TxVFVideoRenderer.VR_VMR9;

Use the following code to get the list of available deinterlacing modes

for I := 0 to VideoCapture1.Video_Renderer_Deinterlace_Modes_GetCount - 1 do
for (int i = 0; i < VideoCapture1.Video_Renderer_Deinterlace_Modes_GetCount(); i++)

Enhanced Video Renderer is a new filter available starting with Windows Vista. It can use additional video acceleration features and is recommended to be used in Windows 7 and later, including all versions of Windows 10.

VideoCapture1.Video_Renderer := VR_EVR;
VideoCapture1.Video_Renderer = VisioForge_Video_Capture_5.TxVFVideoRenderer.VR_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.Screen_Stretch := true;
VideoCapture1.Screen_Stretch = true;

Also, you can use black borders instead of stretching (letterbox).

VideoCapture1.Screen_Stretch := false;
VideoCapture1.Screen_Stretch := false;

Please contact support to get help with this tutorial. Visit our GitHub page to get more code samples.