Share via


WMEncProfile2.GetCodecFourCCFromIndex

Windows Media Encoder SDK banner art

The GetCodecFourCCFromIndex method retrieves the FOURCC value of a specific audio or video codec.

Syntax

Long = WMEncProfile2.GetCodecFourCCFromIndex(enumSrcType, lIndex)

Parameters

enumSrcType

[in]  Member of a WMENC_SOURCE_TYPE enumeration type identifying the media stream type.

lIndex

[in]  Long containing the audio or video codec index.

Return Values

A Long that represents an ASCII version of the codec's FOURCC. To get the FOURCC string, convert the Long value to hexadecimal, which can then be broken down into four pairs of two numbers. Each pair corresponds to the four characters in reverse order.

For example, the return value is 861293911. The hexadecimal value is 33564D57. So, 33 = 3, 56 = V, 4D = M, and 57 = W. Reversed, this value is WMV3, which is the FOURCC value.

Remarks

Four-Character Codes (FOURCC) is a set of codes used to identify data stream formats. FOURCC values are stored in file headers to describe the software technology and data format that was used to produce the multimedia data.

Use the IWMEncAudienceObj.AudioCodec property to retrieve the index of the audio codec that is used by the current profile. Use the AudioCodecCount property to retrieve the total number of audio codecs available in the current profile, which is determined by the variable bit rate (VBR) mode that is specified for the audio stream.

Use the IWMEncAudienceObj.VideoCodec property to retrieve the index of the video codec that is used by the current profile. Use the VideoCodecCount property to retrieve the total number of video codecs available in the current profile, which is determined by the VBR mode that is specified for the video stream.

Example Code

' Create a WMEncProfile2 object.
  Dim Pro As WMEncProfile2
  Set Pro = New WMEncProfile2

' Load a custom profile. REPLACE THE FILE NAME.
  Pro.LoadFromFile "C:\Profiles\CustomProfile.prx"
 
' Retrieve the index of the video codec that is used by the current
' audience.
  Dim lVidCodec As Long
  lVidCodec = Audnc.VideoCodec(0)

' Retrieve the FOURCC value of the video codec.
  Dim lVid4cc As Long
  lVid4cc = Pro.GetCodecFourCCFromIndex(WMENC_VIDEO, lVidCodec)

Requirements

Reference: Windows Media Encoder

Library: wmenc.exe

See Also