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.

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 a modern filter that can use GPU for rendering. It can use all of your video card's capabilities, 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

VideoCapture1.Video_Renderer_Deinterlace_Modes_Fill;
for I := 0 to VideoCapture1.Video_Renderer_Deinterlace_Modes_GetCount - 1 do
cbDeinterlaceModes.Items.Add(VideoCapture1.Video_Renderer_Deinterlace_Modes_GetItem(i));
VideoCapture1.Video_Renderer_Deinterlace_Modes_Fill();
for (int i = 0; i < VideoCapture1.Video_Renderer_Deinterlace_Modes_GetCount(); i++)
cbDeinterlaceModes.Items.Add(VideoCapture1.Video_Renderer_Deinterlace_Modes_GetItem(i));

Enhanced Video Renderer is a filter that is available starting with Windows Vista and is recommended for use. It can use additional video acceleration features and is recommended for use in Windows 7 and later 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_Update;
VideoCapture1.Screen_Stretch = true;
VideoCapture1.Screen_Update();

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

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

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