ILMH264Encoder Interface (4.0)

This is the interface for the LEAD H264 Encoder .

Interface Properties:

Type

Property name

Description

VARIANT_BOOL

EnableRateControl

Indicates whether the H264 encoder Also known as compressor, this is a module or algorithm to compress data. Playing that data back requires a decompressor, or decoder. uses Rate Driven compression or Quality Driven compression. It this property is TRUE, Rate Driven compression is used and the rate is set in the BitRate property. If this is FALSE, Quality Driven compression is used and the quality factor is set in the QualityFactor property.

long

BitRate

The bitrate, in bits per second, when the EnableRateControl value is TRUE.

long

QualityFactor

Contains the video quality factor. A quality factor of 1 gives the highest quality and the largest video file size. A quality factor of 49 gives the lowest quality and smallest file size. This property is valid only if the EnableRateControl property is FALSE.

eH264FRAMEINTERVALUNIT

IFrameIntervalUnit

Represents the unit of IFrameInterval property or how the IFrameInterval property is interpreted by the encoder. If IFrameIntervalUnit = H264INTERVALUNIT_PFRAME, then the IFrameInterval represents the I-frame interval in term of P frames. If IFrameIntervalUnit != H264INTERVALUNIT_FRAME, then I-frame Interval is in terms of P and B frames.

long

IFrameInterval

If IFrameIntervalUnit = H264INTERVALUNIT_PFRAME then this property specifies the number of P frames between two successive I frames plus one. A value of zero means there is only one I in the whole video and all the other frames are either P or B . If this value is one there will be NO P frame between any two I frames. If the value is 2 there will be ONE P frame between any two I frames and so on.

 

If IFrameIntervalUnit = H264INTERVALUNIT_FRAME then this property specifies the number of frames between two successive I-frames, in other words it specifies the "Group of Pictures (GOP)" length. A value of zero means there is only one I-frame in the whole video and all the other frames are either P or B. If this value is one there will no P or B frames between any I frames.

long

PFrameInterval

Specifies the number of B frames between two successive P frames.  Note that all the frames between successive P frames are B frames.

eH264SYMBOLMODE

SymbolMode

Flag that indicates the type of entropy coding to be used. For a list of possible values, refer to eH264SYMBOLMODE.

VARIANT_BOOL

EnableSuperCompression

Flag that indicates whether super compression is enabled. If TRUE, then LEAD's improvement to the H264 compression is enabled. If FALSE, LEAD's improvement to the H264 compression is not used. This option produces very high compression and makes the encoding and decoding processes very fast. If high quality video is desired, it is recommended to disable this option.

This option is recommended for video conferencing and broadcast applications where speed and size are very important and moderate quality is ok.

This property is only available if the output is

H264FORMAT_AUTO, H264FORMAT_STANDARD_H264, H264FORMAT_STANDARD_AVC1,
H264FORMAT_BASELINE_RTP, H264FORMAT_MAIN_RTP, or H264FORMAT_LEAD.

float

 

FrameRate

Sets the playback frame rate, in frames per second, of the compressed video, regardless of the rate of the input stream frames. The LEAD H264 Encoder Also known as compressor, this is a module or algorithm to compress data. Playing that data back requires a decompressor, or decoder. automatically adjusts the input video to match the desired frame rate. The rate is adjusted by dropping or duplicating input frames. If the selected frame rate is lower than the original framerate, the compression will be higher.

Use the value -1 if the output frame rate needs to be the same as the input frame rate.

eH264OUTPUTFORMAT

OutputFormat

Value that specifies the output format. For a list of possible values, refer to eH264OUTPUTFORMAT .

For Flash Encoding with H.264, use H264FORMAT_STANDARD_AVC1 or H264FORMAT_ BASELINE_AVC1. The first will give better compression results.

 

To generate an h.264 RTP stream, select either H264FORMAT_BASELINE_RTP or H264FORMAT_MAIN_RTP. Such values should be selected only for broadcasting or streaming. The encoded stream should not go to a file or multiplexer.

eH264ENCODINGTHREADS

EncodingThreads

The number of threads used during encoding. The maximum number of threads that can be used is 2. Using two threads with a dual core machine or 2 CPUs will increase the encoding speed significantly. Possible values are:

Auto: Have the LEAD H264 Encoder determine the appropriate number of threads.

1: Uses 1 thread during encoding

2: Uses 2 threads during encoding

X: Uses X threads during encoding and X slices per frame

eH264RESTRICTFORMATS

RestrictAvailableOutputFormats

Restricts the available output formats that LEAD H264 encoder offers on its output pin. If it is set to H264FRESTRICTFORMATS_NONE, all the available output formats will be listed. If it is set to H264RESTRICTFORMATS_AVC1, the encoder (and property page) will list only the AVC1 Main and Baseline profiles AVC1 formats, which means the encoder offers only the FLASH formats.

 

 

Interface Methods:

HRESULT WriteToRegistry ()

Description

Writes the values of all of the properties listed above to the system registry, so that the encoder will remember these settings the next time it is used.

Return

S_OK if successful, S_FALSE otherwise.

 

HRESULT SetNextFrameAsKey ()

Description

Force a key-frame during encoding or changing the type of the encoding frame to be Key frame / I frame. This method could be useful for streaming.

Return

S_OK if always

 

HRESULT  ResetToDefaults (eH264APILEVEL ApiLevel)

Parameters

eH264APILEVEL ApiLevel

Description

Resets resizing to default values. The ApiLevel determines which default values to use. Current applications should set ApiLevel to H264_APILEVEL_1 = 0.

LEAD H264 Encoder might change in the future and have different properties or default behaviour. Calling this method ensures the filter will have the same default values as they were at the time you developed your application.

It is recommended you call ResetToDefaults(H264_APILEVEL_1) before you start setting properties and start calling other methods for this interface.

Returns

S_OK if connected, S_FALSE otherwise.

 

 

 

Data Types:

1. eH264SYMBOLMODE:

typedef enum
{
   H264SYMBOL_CAVLC = 0,
   H264SYMBOL_CABAC = 1
} eH264SYMBOLMODE;

Lists the possible values for the entropy coding mode, set in the SymbolMode property.

 

2. eH264OUTPUTFORMAT:

Lists the possible values for the output mode, set in the OutputFormat property.

typedef enum
{
   H264FORMAT_AUTO = 0,
   H264FORMAT_STANDARD_H264 = 1,// Uses h.264 Main profile
   H264FORMAT_STANDARD_AVC1 = 2, // For Flash uses h.264 Main Profile
   H264FORMAT_LEAD = 3, //Uses h.264 Baseline Profile
   H264FORMAT_IPOD = 4,
   H264FORMAT_PSP = 5,
   H264FORMAT_BASELINE_H264 = 6, // Uses h.264 Baseline Profile
   H264FORMAT_BASELINE_AVC1 = 7, // For Flash uses h.264 Baseline Profile
   H264FORMAT_BASELINE_RTP = 8, // Uses h.264 Baseline Profilez
   H264FORMAT_MAIN_RTP = 9 // Uses h.264 Main Profile
} eH264OUTPUTFORMAT;

 

3. eH264ENCODINGTHREADS

typedef enum
{
   H264THREAD_AUTO = 0,
   H264THREAD_1 = 1,
   H264THREAD_2 = 2,
   H264THREAD_3 = 3,
   H264THREAD_4 = 4,
   H264THREAD_5 = 5,
   H264THREAD_6 = 6,
   H264THREAD_7 = 7,
   H264THREAD_8 = 8,
   H264THREAD_9 = 9,
   H264THREAD_10 = 10,
   H264THREAD_11 = 11,
   H264THREAD_12 = 12,
   H264THREAD_13 = 13,
   H264THREAD_14 = 14,
   H264THREAD_15 = 15,
   H264THREAD_16 = 16
} eH264ENCODINGTHREADS;

Lists the possible values for the number of encoding threads, set in the EncodingThreads property.

 

4. eH264RESTRICTFORMATS

typedef enum
{
   H264FRESTRICTFORMATS_NONE = 0,
   H264RESTRICTFORMATS_AVC1 = 1,
} eH264RESTRICTFORMATS;

Lists the possible values for the available output formats, set in RestrictAvailableOutputFormats property.

 

 

5. eH264APILEVEL

typedef enum

{

H264_APILEVEL_1 = 0

} eH264APILEVEL;