Live Video transformer SDK

Live Media Server makes it possible to access and modify raw video frames before they are compressed and sent to the Media Server for distribution. The following picture demonstrates this.

To develop a video transformer one should create a COM object that supports both STA and MTA apartments and exposes interface IUVideoTransformer.

Interface Description

Interface

IUVideoTransformer 

Interface Type

Custom Interface

Defined in UVideoTransformer.tlb

Description

Defines communication protocol between Live Media Server and Video Transformer component.

The interface defines a single method.

IUVideoTransformer   

Type

Method

Function

Transform

Parameters

[in] LONG

lResourceID

Live resource ID.

[in] U_VideoFrame*

pInFrame

Frame to be transformed.

[out] U_VideoFrameData**  pOutFrame Transformed frame.

Return

HRESULT

S_OK or error if call failed.

Description

Adds session ID to the Media Server internal session manager. 

U_VideoFrame and  U_VideoFrameData structures defined as follows.
 

U_VideoFrame

Type

Structure

Fields

GUID

subtype

DirectShow video subtype. In current version only RGB24 subtype is supported for transformation.

long

lWidth

Frame width in pixels

long lHeight Frame height in pixels
__int64 nStartTimeStamp Frame start time in 100s nanoseconds
__int64 nEndTimeStamp Frame end time in 100s nanoseconds
U_VideoFrameData  Frame Frame data

Description

Structure defining video frame to be transformed.

U_VideoFrameData

Type

Structure

Fields

ULONG

nLength

Frame length in bytes

BYTE*

pFrame

Frame data

Description

Structure defining video frame data.

Refer to ULogoBlend sample for more details.