Image adjustments (brightness, contrast, etc)
Video stream image adjustments
When the frame grabber is enabled, it is possible to adjust the brightness, contrast, hue and saturation of the video stream by using:
These properties affect the whole video stream, therefore the captured frames and the recorded streams will be affected.
On the other hand, each of these image processing operations requires CPU when the corresponding property is "in use" (when its value is <> 0).
Greyscale and inverted colors
When the frame grabber is enabled, it is possible:
-
to convert the video stream to greyscale by enabling VideoProcessing_GrayScale
-
to invert the colors by enabling VideoProcessing_InvertColors
Image adjustments and the OnFrameBitmap event
By default (OverlayAfterTransform = false), the brightness, contrast, hue, saturation, greyscale and inverted colors adjustments are applied after the OnFrameBitmap event: the bitmap received by the event is the frame before these adjustments, while the frame passed downstream (video window, recording) is adjusted.
To receive the adjusted frame in OnFrameBitmap, e.g. when the application displays this bitmap itself (WPF Image control, etc.), enable OverlayAfterTransform before starting the preview:
VideoGrabber.FrameGrabber = TFrameGrabber.fg_PreviewStream;
VideoGrabber.OverlayAfterTransform = true;
VideoGrabber.OnFrameBitmap += VideoGrabber_OnFrameBitmap;
VideoGrabber.StartPreview();
// then, at any time:
VideoGrabber.VideoProcessing_Brightness = 40;
VideoGrabber.VideoProcessing_Contrast = 20;
VideoGrabber.VideoProcessing_GrayScale = true;
With OverlayAfterTransform = true, the text and image overlays are drawn after the adjustments and keep their colors (e.g. they are not converted to greyscale). See Overlays before or after transforms.
Pixellization
The video frames will be pixellized by assigning to VideoProcessing_Pixellization a value greater than 1.
VMR9 display image adjustments
Unlike the video stream image adjustments above that require CPU, it is possible to adjust the brightness, contrast, hue and saturation at the graphics card level by using the VMR9 video renderer.
Of course, this processing affects only the display, and not the captured frames or the recorded streams.
The corresponding functions are:
GetVMR9ImageAdjustmentBounds -> returns the bounds of a setting (e.g. the brightness), useful e.g. to set up a trackbar
IsVMR9ImageAdjustmentAvailable -> returns true if a setting (e.g. the brightness) is available
SetVMR9ImageAdjustmentValue -> sets a setting value (e.g. the brightness).