Share via


IWMEncAudienceObj.VideoCodec

Windows Media Encoder SDK banner art

The VideoCodec property specifies and retrieves the index of the video codec that is used by the current audience.

Syntax

IWMEncAudienceObj.VideoCodec(iRenderSiteIndex) = Long
Long = IWMEncAudienceObj.VideoCodec(iRenderSiteIndex)

Parameters

iRenderSiteIndex

[in]  Integer containing the audience stream index. Because an audience can only contain one stream of each type, iRenderSiteIndex must be zero.

Property Value

A Long that indicates the video codec index.

Remarks

This video codec index corresponds to WMEncProfile2.VideoCodecCount, which indicates the total number of video codecs that the profile supports for its VBR mode. Use the WMEncProfile2.EnumVideoCodec method to retrieve the name of the video codec and its FOURCC value.

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"

' Create an IWMEncAudienceObj object, selecting the first audience (0)
' in the profile.
  Dim Audnc As IWMEncAudienceObj
  Set Audnc = Pro.Audience(0)

' Retrieve the index of the video codec that is used by the current
' audience.
  Dim lVidCodec As Long
  lVidCodec = Audnc.VideoCodec(0)

' Using the video codec index, retrieve its name and FOURCC value.
  Dim lVid4cc As Long, vVidCodecName As Variant
  lVid4cc = Pro.EnumVideoCodec(Audnc.VideoCodec(0), vVidCodecName)

Requirements

Reference: Windows Media Encoder

Library: wmenc.exe

See Also