ILMFVStabilize Interface

This is the interface for the LEAD Video Stabilizer Transform.

Data Types

lmvstab_enumClippingOption

Summary

Describes possible cropping options.

Syntax

typedef [v1_enum] enum lmvstab_enumClippingOption 
{ 
   lmvstab_CLIPPINGOPTIONS_OUTLINE, 
   lmvstab_CLIPPINGOPTIONS_CROP, 
   lmvstab_CLIPPINGOPTIONS_CROPANDSTRETCH 
} lmvstab_enumClippingOption ; 
Constant Description
lmvstab_CLIPPINGOPTIONS_OUTLINE Frame the resulting video with bands of the specified color. The video size remains the same as that of the original.
lmvstab_CLIPPINGOPTIONS_CROP Crop the video. Video size is smaller than that of the original.
lmvstab_CLIPPINGOPTIONS_CROPANDSTRETCH Crop the video but then resize it so it is the same size as the original.

lmvstab_GlobalEstimationCoefficients

Summary

Describes the possible stabilization options.

Syntax

typedef [v1_enum] enum lmvstab_GlobalEstimationCoefficients 
{ 
   lmvstab_GLOBALESTIMATIONCOEFFICIENTS_X_Y, 
   lmvstab_GLOBALESTIMATIONCOEFFICIENTS_X_Y_THETA 
} lmvstab_GlobalEstimationCoefficients ; 
Constant Description
lmvstab_GLOBALESTIMATIONCOEFFICIENTS_X_Y Fix the shaking that occurs along the x and y axes.
lmvstab_GLOBALESTIMATIONCOEFFICIENTS_X_Y_THETA Fix the shaking that occurs along both axes as well as fix shaking from rotation.

lmvstab_GlobalEstimationQuality

Summary

Describes quality options.

Syntax

typedef [v1_enum] enum lmvstab_GlobalEstimationQuality 
{ 
   lmvstab_GLOBALESTIMATIONQUALITY_1, 
   lmvstab_GLOBALESTIMATIONQUALITY_2, 
   lmvstab_GLOBALESTIMATIONQUALITY_3, 
   lmvstab_GLOBALESTIMATIONQUALITY_4 
} lmvstab_GlobalEstimationQuality ; 
Constant Description
lmvstab_GLOBALESTIMATIONQUALITY_1 Highest quality but slow processing
lmvstab_GLOBALESTIMATIONQUALITY_2 More performance, lower quality
lmvstab_GLOBALESTIMATIONQUALITY_3 Slower performance, better quality
lmvstab_GLOBALESTIMATIONQUALITY_4 Fastest but worst quality

lmvstab_PathSmoothingLevel

Summary

Describes the amount of path smoothing. Many factors determine which amount is best for a particular video, including:

Input video frames per second. Higher frame rates need to use higher levels (lmvstab_PATHSMOOTHINGLEVEL_8).

Whether a stationary camera was used. If so, use a higher level value (8).

Whether a moving camera was used. If so, use levels (6-4).

Whether you want to minimize the amount of clipping. If so, use the lower levels (1-4).

Syntax

typedef [v1_enum] enum lmvstab_PathSmoothingLevel 
{ 
   lmvstab_PATHSMOOTHINGLEVEL_1 = 4, 
   lmvstab_PATHSMOOTHINGLEVEL_2 = 8, 
   lmvstab_PATHSMOOTHINGLEVEL_3 = 12, 
   lmvstab_PATHSMOOTHINGLEVEL_4 = 16, 
   lmvstab_PATHSMOOTHINGLEVEL_5 = 24, 
   lmvstab_PATHSMOOTHINGLEVEL_6 = 32, 
   lmvstab_PATHSMOOTHINGLEVEL_7 = 64, 
   lmvstab_PATHSMOOTHINGLEVEL_8 = 128, 
   lmvstab_PATHSMOOTHINGLEVEL_COUNT = 8 
} lmvstab_PathSmoothingLevel ; 

lmvstab_InterpolationType

Summary

Describes the possible interpolation options when shifting and rotating input frames to get stabilized output.

Syntax

typedef [v1_enum] enum lmvstab_InterpolationType 
{ 
   lmvstab_INTERPOLATIONTYPE_NEAREST, 
   lmvstab_INTERPOLATIONTYPE_BILINEAR 
} lmvstab_InterpolationType ; 

Two interpolation methods are available, as follows:

Constant Description
lmvstab_INTERPOLATIONTYPE_NEAREST Simple and fast interpolation
lmvstab_INTERPOLATIONTYPE_BILINEAR Better quality interpolation but slower

Properties

Type Name Description
VARIANT_BOOL Enabled Enables or disables video stabilization. If set to VARIANT_FALSE, the transform passes the video samples intact.
VARIANT_BOOL AutoReconnect If set to VARIANT_TRUE, the transform can apply changes that affect media types while the media session is running (without having to stop and manually reconnect).This includes options such as clipping.
VARIANT_BOOL ROIEnabled If set to VARIANT_TRUE, the transform processes only the region of interest. Otherwise, the entire frame gets processed.The region of interest restricts the area considered when reducing shaking, but the reductions are applied to the entire frame. Limiting the transform to a portion of the video increases performance, allowing the transform to be run in real time.
LONG ROITop Top coordinate, in pixels, of the region of interest
LONG ROILeft Left coordinate, in pixels, of the region of interest
LONG ROIBottom Bottom coordinate, in pixels, of the region of interest
LONG ROIRight Right coordinate, in pixels, of the region of interest
lmvstab_GlobalEstimationCoefficients GlobalEstimationCoefficients Gets or sets the lmvstab_GlobalEstimationCoefficients value to be used. This describes the type of stabilization to be performed.
lmvstab_GlobalEstimationQuality GlobalEstimationQuality Gets or sets the lmvstab_GlobalEstimationQuality value to be used. This value describes the balance between the speed and the quality of the processing.
lmvstab_PathSmoothingLevel PathSmoothingLevel Gets or sets the lmvstab_PathSmoothingLevel values to be used.
OLE_COLOR BkFillColor Color to use to fill any empty areas resulting from processing.
VARIANT_BOOL CropEnabled If set to VARIANT_TRUE, the transform will apply cropping on the frames. Otherwise, the frame processed normally.
LONG LeftRightCropMargin Left and right crop margin
LONG TopBottomCropMargin Top and bottom crop margin
lmvstab_InterpolationType InterpolationType Gets and sets the lmvstab_InterpolationType value to be used.
lmvstab_enumClippingOption ClippingOption Gets and sets the lmvstab_enumClippingOption value to be used.
VARIANT_BOOL UseAdvancedEngine Enables or disables the usage of the Advanced stabilization engine, which is built and configured automatically to optimize performance and video edges quality. The Advanced stabilization engine depends on certain capabilities in the host system. Use the AdvancedEngineAvailable property to determine whether the engine is available. If set to VARIANT_TRUE, the filter will use the Advanced stabilization engine and all other filter properties will have no effect. If set to VARIANT_FALSE, the filter will use the Standard engine configured with all other filter properties.
VARIANT_BOOL AdvancedEngineAvailable (Read only) Gets a value indicating whether the Advanced stabilization engine is available for use. This property checks for the availability of certain capabilities in the system.

Methods

HRESULT ResetToDefaults()

Description

Call this method to restore default options for all properties.

The transform might change in the future and have different properties or default behavior. Calling this method ensures the transform will have the same default values as they were at the time you developed your application.

Returns

S_OK always.

HRESULT LoadAttributes()

Description

Loads transform settings from the registry. The Media Foundation transforms import the settings from the registry only at creation time. This method will force the transform to re-load its settings from the registry. If the transform has no settings to load from the registry, E_NOTIMPL is returned.

Returns

S_OK if successful, S_FALSE otherwise.

HRESULT SaveAttributes()

Description

Writes transform settings to the registry.

If the transform has no settings to write to the registry, E_NOTIMPL is returned.

Comments

Notes: Currently, this transform stabilizes video in the vertical, horizontal, and angular directions. Shake from other directions can cause unexpected results.

For best results, make sure any moving objects inside the video are smaller than 15% of the video frame size.

Returns

S_OK if successful, S_FALSE otherwise.

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Transforms C API Help

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.