Share via


IWMEncPostViewCollection.ViewBandwidth

Windows Media Encoder SDK banner art

The ViewBandwidth property specifies and retrieves the bit rate of the audience to view.

Syntax

IWMEncPostViewCollection.ViewBandwidth = Long
Long = IWMEncPostViewCollection.ViewBandwidth

Parameters

This property takes no parameters.

Property Value

A Long that contains the bit rate of the audience to view.

Remarks

If you are using a profile that supports multiple bit rates to encode the video stream, use the ViewBandwidth property to choose the audience to preview by specifying its bit rate. Specify 0 to select no video stream for the preview. You can also switch between audiences while encoding. Use the WMEncProfile2 and IWMEncAudienceObj objects to determine which profiles contain multiple audiences.

If you specify a bit rate that does not exist, the first audience with a bit rate lower than the specified bit rate is viewed (or the lowest one if none are lower than the one you specify). For example, the available bit rates for a stream are 100 Kbps and 500 Kbps. If you specify 400 Kbps or 50 Kbps, the 100 Kbps stream is viewed. If you specify anything higher than 500 Kbps, the 500 Kbps stream is viewed.

To display previews and postviews, you must add the Windows Media Encoder Preview Control reference to the project. For more information, see Programming in Visual Basic.

Example Code

' Create a WMEncoder object.
  Dim Encoder As WMEncoder
  Set Encoder = New WMEncoder

' Configure the encoding session including the input sources,
' the profile, and the output. Specify a profile that contains
' multiple audiences.

' Retrieve an IWMEncDataViewCollection object from the
' video source object to display a postview.
  Dim DVColl_Postview As IWMEncPostViewCollection
  Set DVColl_Postview = SrcVid.PostviewCollection

' Create a WMEncDataView object.
  Dim PostView As WMEncDataView
  Set PostView = New WMEncDataView

' Add the WMEncDataView object to the collection.
  Dim lPostviewStream As Long
  lPostviewStream = DVColl_Postview.Add(PostView)

' Start encoding.
  Encoder.Start

' Display the stream postview in a frame called PostviewFrame.
  PostView.SetViewProperties lPostviewStream, PostviewFrame.hWnd
  PostView.StartView (lPostviewStream)

' Specify a bit rate to display (for example, 56K).
  DVColl_Postview.ViewBandwidth = 56000

Requirements

Reference: Windows Media Encoder Preview Control

Library: wmprevu.dll

See Also