IWMEncSourceGroup.AutoArchive

Windows Media Encoder SDK banner art

The AutoArchive property specifies and retrieves a value that indicates the nature of the archiving operation if WMEncoder.EnableAutoArchive is set to True.

Syntax

IWMEncSourceGroup.AutoArchive(enumArchiveType) = WMENC_ARCHIVE_OPERATION
WMENC_ARCHIVE_OPERATION = IWMEncSourceGroup.AutoArchive(enumArchiveType)

Parameters

enumArchiveType

[in]  Specifies a WMENC_ARCHIVE_TYPE enumeration type indicating where content can be archived.

Property Value

A WMENC_ARCHIVE_OPERATION enumeration type that indicates whether encoded content will be archived when the source group is made active and the encoding session starts.

If this property fails, it returns an error number.

Number Description
0xC00D1B77 You can save encoded content only to a local file.
0xC00D1B78 You can only start, stop, or pause the archiving process.

Remarks

Use the AutoArchive property to selectively archive source groups. For instance, if you are encoding a static welcome screen, a live presentation and a static goodbye screen, you can utilize disk space more efficiently by only archiving the live presentation. Use the WMEncoder.EnableAutoArchive property to specify whether archiving will automatically occur when the encoding session starts. Use the WMEncoder.Archive method to manually control the archiving process. If both the EnableAutoArchive and AutoArchive properties are set to True, archiving automatically starts when encoding of the relevant source group starts.

Example Code

' Create a WMEncoder object.
Dim 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 i As Integer
Dim iAudCount As Integer
Dim iVidCount 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)

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

' You can also use the AutoSetFileSource property to
' automatically parse a file and add the source streams
' to the source group.
'
'    SrcGrp.AutoSetFileSource ("C:\filename.avi")

' 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 = "Windows Media Video 8 for Local Area Network (384 Kbps)" Then
        SrcGrp.Profile = Pro
        Exit For
    End If
Next

' Change the name of the source group.
SrcGrp.Name = "Music Only"

' Retrieve the number of audio and video streams
' in the source group.
iAudCount = SrcGrp.SourceCount(WMENC_AUDIO)
iVidCount = SrcGrp.SourceCount(WMENC_VIDEO)

' Remove the video stream. In the current release of the
' Windows Media Encoder SDK, a source group can contain
' at most only one audio, one video, and one script stream.
' You must verify that the count is not 0 before deleting
' the source stream.
If iVidCount <> 0 Then
    SrcGrp.RemoveSource WMENC_VIDEO, 0
End If

' Specify automatic archiving when the source group
' is active.
SrcGrp.AutoArchive(WMENC_ARCHIVE_LOCAL) = WMENC_ARCHIVE_START

' Start the encoding process.
SrcGrp.PrepareToEncode True

Requirements

Reference: Windows Media Encoder

Library: wmenc.exe

See Also