Skip to main content

Video balance

The block processes the video stream and allows you to change brightness, contrast, hue, and saturation. Use the VideoBalanceVideoEffect class to configure the block settings.

Block info

Name: VideoBalanceBlock.

Pin directionMedia typePins count
InputUncompressed video1
OutputUncompressed video1

The sample pipeline

Sample code

var pipeline = new MediaBlocksPipeline();

var filename = "test.mp4";
var fileSource = new UniversalSourceBlock(await UniversalSourceSettings.CreateAsync(new Uri(filename)));

var videoBalance = new VideoBalanceBlock(new VideoBalanceVideoEffect() { Brightness = 0.25 });
pipeline.Connect(fileSource.VideoOutput, videoBalance.Input);

var videoRenderer = new VideoRendererBlock(pipeline, VideoView1);
pipeline.Connect(videoBalance.Output, videoRenderer.Input);

await pipeline.StartAsync();

Platforms

Windows, macOS, Linux, iOS, Android.