WMEncoder.EnableAutoArchive

Windows Media Encoder SDK banner art

The EnableAutoArchive property specifies and retrieves a Boolean value indicating whether the archiving process will start automatically when the encoding process starts.

Syntax

WMEncoder.EnableAutoArchive = Boolean
Boolean = WMEncoder.EnableAutoArchive

Parameters

This property takes no parameters.

Property Value

A Boolean indicating whether archiving is automatic.

Remarks

Use the IWMEncSourceGroup.AutoArchive property to automatically control source group archiving. If both the EnableAutoArchive and AutoArchive properties are set to True, archiving automatically starts when encoding starts.

Example Code

' Create a WMEncoder object. To handle the events raised by the
' WMEncoder object, use the WithEvents keyword.
Dim WithEvents Encoder As WMEncoder
Set Encoder = New WMEncoder

' Declare objects and variables.
Dim SrcGrpColl As IWMEncSourceGroupCollection
Dim SrcGrp As IWMEncSourceGroup
Dim SrcAud As IWMEncSource
Dim SrcVid As IWMEncVideoSource
Dim ProColl As IWMEncProfileCollection
Dim Pro As IWMEncProfile
Dim File As IWMEncFile
Dim i As Integer

' Create an IWMEncSourceGroupCollection object.
Set SrcGrpColl = Encoder.SourceGroupCollection

' Create an IWMEncSourceGroup object.
Set SrcGrp = SrcGrpColl.Add("SG_1")

' Create an audio and a video source object.
Set SrcAud = SrcGrp.AddSource(WMENC_AUDIO)
Set SrcVid = SrcGrp.AddSource(WMENC_VIDEO)

' Create an IWMEncFile object.
Set File = Encoder.File

' Specify the .avi source file.
SrcAud.SetInput "C:\file_name.avi"
SrcVid.SetInput "C:\file_name.avi"

' Specify the output Windows Media file.
File.LocalFileName = "C:\file_name.wmv"

' Loop through the collection of system profiles to set
' a specific profile into the source group object.
Set ProColl = Encoder.ProfileCollection
For i = 0 To ProColl.Count - 1
    Set Pro = ProColl.Item(i)
    If Pro.Name = "name of a system profile" Then
        SrcGrp.Profile = ProColl.Item(i)
        Exit For
    End If
Next

' Start archiving when the encoding process starts.
Encoder.EnableAutoArchive = True

' Retrieve the Boolean value.
Dim bAutoArchive As Boolean
bAuroarchive = Encoder.EnableAutoArchive

' Initialize the encoding process.
Encoder.PrepareToEncode True

' Start the encoding process.
Encoder.Start

Requirements

Reference: Windows Media Encoder

Library: wmenc.exe

See Also