Share via


WMEncBasicEdit.Duration

Windows Media Encoder SDK banner art

The Duration property retrieves the duration of the input file.

Syntax

WMENC_LONGLONG = WMEncBasicEdit.Duration

Parameters

This property takes no parameters.

Property Value

A WMENC_LONGLONG that indicates the duration of the file, in milliseconds.

Remarks

This property is read-only.

Example Code

' Create the WMEncBasicEdit object.
  Dim BasicEdit As WMEncBasicEdit
  Set BasicEdit = New WMEncBasicEdit

' Specify the input, output, and configuration files.
  BasicEdit.MediaFile = "C:\InputFile.wmv"
  BasicEdit.OutputFile = "C:\OutputFile.wmv"
  BasicEdit.ConfigFile = "C:\ConfigFile.txt"

' Retrieve the duration of the input file, in seconds.
  Dim lFileDur As Long
  lFileDur = BasicEdit.Duration / 1000

' Retrieve the profile used by the input file.
  Dim Pro As WMEncProfile2
  Set Pro = BasicEdit.Profile

' Save the profile used by the input file.
  BasicEdit.SaveProfile "C:\BasicEditPro.prx"

' Add indexing to the file.
  BasicEdit.Index = True

' Specify a mark-in time of 5 seconds and a mark-out time of 10 seconds.
  BasicEdit.MarkIn = 5000
  BasicEdit.MarkOut = 10000

' Specify an output configuration file.
  BasicEdit.SaveConfigFile "C:\ConfigFile2.txt"

' Start the basic edit process.
  BasicEdit.Start

' Retrieve the run state.
  Dim BERunState as WMENC_BASICEDIT_STATE
  BERunState = BasicEdit.RunState

' Retrieve a run-time error.
  Dim lError As Long
  lError = BasicEdit.ErrorState
  If lError = 123456 Then
  ' Process the error.
  End If

' You can use a timer to retrieve the percentage complete.
  Dim lPercentComplete As Long
  lPercentComplete = BasicEdit.ProgressPercent

' Stop the edit process manually.
  ' BasicEdit.Stop

Requirements

Reference: Windows Media Encoder

Library: wmenc.exe

See Also