#
OpenGL Video Effects - VisioForge Media Blocks SDK .Net
OpenGL video effects in VisioForge Media Blocks SDK .Net allow for powerful, hardware-accelerated manipulation of video streams. These effects can be applied to video content processed within an OpenGL context, typically via blocks like GLVideoEffectsBlock
or custom OpenGL rendering pipelines. This guide covers the available effects, their configuration settings, and other related OpenGL types.
#
Base Effect: GLBaseVideoEffect
All OpenGL video effects inherit from the GLBaseVideoEffect
class, which provides common properties and events.
Events:
OnUpdate
: Occurs when effect properties need to be updated in the pipeline. CallOnUpdateCall()
to trigger it.
#
Available Video Effects
This section details the various OpenGL video effects you can use. These effects are typically added to a GLVideoEffectsBlock
or a similar OpenGL processing element.
#
Alpha Effect (GLAlphaVideoEffect
)
Replaces a selected color with an alpha channel or sets/adjusts the existing alpha channel.
Properties:
Associated Enum: GLAlphaVideoEffectMode
Defines the mode of operation for the Alpha video effect.
#
Blur Effect (GLBlurVideoEffect
)
Applies a blur effect using a 9x9 separable convolution. This effect does not have additional configurable properties beyond those inherited from GLBaseVideoEffect
.
#
Bulge Effect (GLBulgeVideoEffect
)
Creates a bulge distortion on the video. This effect does not have additional configurable properties beyond those inherited from GLBaseVideoEffect
.
#
Color Balance Effect (GLColorBalanceVideoEffect
)
Adjusts the color balance of the video, including brightness, contrast, hue, and saturation.
Properties:
#
Deinterlace Effect (GLDeinterlaceVideoEffect
)
Applies a deinterlacing filter to the video.
Properties:
Associated Enum: GLDeinterlaceMethod
Defines the method for the Deinterlace video effect.
#
Fish Eye Effect (GLFishEyeVideoEffect
)
Applies a fish-eye lens distortion effect. This effect does not have additional configurable properties beyond those inherited from GLBaseVideoEffect
.
#
Flip Effect (GLFlipVideoEffect
)
Flips or rotates the video.
Properties:
Associated Enum: GLFlipVideoMethod
Defines the video flip or rotation method.
#
Glow Lighting Effect (GLGlowLightingVideoEffect
)
Adds a glow lighting effect to the video. This effect does not have additional configurable properties beyond those inherited from GLBaseVideoEffect
.
#
Grayscale Effect (GLGrayscaleVideoEffect
)
Converts the video to grayscale. This effect does not have additional configurable properties beyond those inherited from GLBaseVideoEffect
.
#
Heat Effect (GLHeatVideoEffect
)
Applies a heat signature-like effect to the video. This effect does not have additional configurable properties beyond those inherited from GLBaseVideoEffect
.
#
Laplacian Effect (GLLaplacianVideoEffect
)
Applies a Laplacian edge detection filter.
Properties:
#
Light Tunnel Effect (GLLightTunnelVideoEffect
)
Creates a light tunnel visual effect. This effect does not have additional configurable properties beyond those inherited from GLBaseVideoEffect
.
#
Luma Cross Processing Effect (GLLumaCrossProcessingVideoEffect
)
Applies a luma cross-processing (often "xpro") effect. This effect does not have additional configurable properties beyond those inherited from GLBaseVideoEffect
.
#
Mirror Effect (GLMirrorVideoEffect
)
Applies a mirror effect to the video. This effect does not have additional configurable properties beyond those inherited from GLBaseVideoEffect
.
#
Resize Effect (GLResizeVideoEffect
)
Resizes the video to the specified dimensions.
Properties:
#
Sepia Effect (GLSepiaVideoEffect
)
Applies a sepia tone effect to the video. This effect does not have additional configurable properties beyond those inherited from GLBaseVideoEffect
.
#
Sin City Effect (GLSinCityVideoEffect
)
Applies a "Sin City" movie style effect (grayscale with red highlights). This effect does not have additional configurable properties beyond those inherited from GLBaseVideoEffect
.
#
Sobel Effect (GLSobelVideoEffect
)
Applies a Sobel edge detection filter.
Properties:
#
Square Effect (GLSquareVideoEffect
)
Applies a "square" distortion or pixelation effect. This effect does not have additional configurable properties beyond those inherited from GLBaseVideoEffect
.
#
Squeeze Effect (GLSqueezeVideoEffect
)
Applies a squeeze distortion effect. This effect does not have additional configurable properties beyond those inherited from GLBaseVideoEffect
.
#
Stretch Effect (GLStretchVideoEffect
)
Applies a stretch distortion effect. This effect does not have additional configurable properties beyond those inherited from GLBaseVideoEffect
.
#
Transformation Effect (GLTransformationVideoEffect
)
Applies 3D transformations to the video, including rotation, scaling, and translation.
Properties:
#
Twirl Effect (GLTwirlVideoEffect
)
Applies a twirl distortion effect. This effect does not have additional configurable properties beyond those inherited from GLBaseVideoEffect
.
#
X-Ray Effect (GLXRayVideoEffect
)
Applies an X-ray like visual effect. This effect does not have additional configurable properties beyond those inherited from GLBaseVideoEffect
.
#
OpenGL Effect Identification: GLVideoEffectID
Enum
This enumeration lists all available OpenGL video effect types, used by GLBaseVideoEffect.ID
.
#
OpenGL Rendering and View Configuration
These types assist in configuring how video is rendered or viewed in an OpenGL context, especially for specialized scenarios like VR or custom display setups.
#
Equirectangular View Settings (GLEquirectangularViewSettings
)
Manages settings for rendering equirectangular (360-degree) video, commonly used in VR applications. Implements IVRVideoControl
.
Properties:
Methods:
IsModeSupported(VRMode mode)
: Checks if the specifiedVRMode
is supported.
Events:
SettingsChanged
: Occurs when any view setting is changed.
#
Video Renderer Settings (GLVideoRendererSettings
)
Configures general properties for an OpenGL-based video renderer.
Properties:
Associated Enum: GLVideoRendererRotateMethod
Defines rotation methods for the OpenGL video renderer.
#
Custom OpenGL Shaders
Allows for the application of custom GLSL shaders to the video stream.
#
Shader Definition (GLShader
)
Represents a pair of vertex and fragment shaders.
Properties:
Constructors:
GLShader()
GLShader(string vertexShader, string fragmentShader)
#
Shader Settings (GLShaderSettings
)
Configures custom GLSL shaders for use in the pipeline.
Properties:
Constructors:
GLShaderSettings()
GLShaderSettings(string vertex, string fragment)
GLShaderSettings(GLShader shader)
#
Image Overlays in OpenGL
Provides settings for overlaying static images onto a video stream within an OpenGL context.
#
Overlay Settings (GLOverlaySettings
)
Defines the properties of an image overlay.
Properties:
Constructor:
GLOverlaySettings(string filename)
#
OpenGL Video Mixing
These types are used to configure an OpenGL-based video mixer, allowing multiple video streams to be combined and composited.
#
Mixer Settings (GLVideoMixerSettings
)
Extends VideoMixerBaseSettings
for OpenGL-specific video mixing. It manages a list of GLVideoMixerStream
objects and inherits properties like Width
, Height
, and FrameRate
.
Methods:
AddStream(GLVideoMixerStream stream)
: Adds a stream to the mixer.RemoveStream(GLVideoMixerStream stream)
: Removes a stream from the mixer.SetStream(int index, GLVideoMixerStream stream)
: Replaces a stream at a specific index.
Constructors:
GLVideoMixerSettings(int width, int height, VideoFrameRate frameRate)
GLVideoMixerSettings(int width, int height, VideoFrameRate frameRate, List<VideoMixerStream> streams)
#
Mixer Stream (GLVideoMixerStream
)
Extends VideoMixerStream
and defines properties for an individual stream within the OpenGL video mixer. Inherits Rectangle
, ZOrder
, and Alpha
from VideoMixerStream
.
Properties:
Constructor:
GLVideoMixerStream(Rect rectangle, uint zorder, double alpha = 1.0)
#
Blend Equation (GLVideoMixerBlendEquation
Enum)
Specifies how source and destination colors are combined during blending.
#
Blend Function (GLVideoMixerBlendFunction
Enum)
Defines factors for source and destination colors in blending operations. (Rs, Gs, Bs, As are source color components; Rd, Gd, Bd, Ad are destination; Rc, Gc, Bc, Ac are constant color components).
#
Virtual Test Sources for OpenGL
These settings classes are used to configure virtual sources that generate test patterns directly within an OpenGL context.
#
Virtual Video Source Settings (GLVirtualVideoSourceSettings
)
Configures a source block (GLVirtualVideoSourceBlock
) that produces test video data. Implements IMediaPlayerBaseSourceSettings
and IVideoCaptureBaseVideoSourceSettings
.
Properties:
Associated Enum: GLVirtualVideoSourceMode
Defines the test pattern generated by GLVirtualVideoSourceBlock
.
Methods:
Task<MediaFileInfo> ReadInfoAsync()
: Asynchronously reads media information (returns synthetic info based on settings).MediaBlock CreateBlock()
: Creates aGLVirtualVideoSourceBlock
instance configured with these settings.