IConfigAviMux::SetMasterStream method

The SetMasterStream method specifies a stream that will be used to synchronize the other streams in the file.

Syntax


HRESULT SetMasterStream(
  [in]  LONG iStream
);

Parameters

iStream [in]

Specifies the index of the stream, or –1 to indicate no master stream. The AVI Mux writes one stream for each connected input pin. Stream numbers are indexed from zero.

Return value

Returns an HRESULT value. Possible values include the following.

Return codeDescription
E_INVALIDARG

Invalid argument.

S_OK

Success.

 

Remarks

If you are capturing audio and video from two different sources, use this method to synchronize the streams. Streams coming from separate capture sources may be captured at slightly different rates. If you specify a master stream, the AVI Mux adjusts the playback rates for the other streams, to compensate for any drift that might occur.

It is recommended to use the audio stream as the master stream, because minor adjustments to the video playback rate are less noticeable than changes to the audio playback rate. Also, modifying the audio playback rate will cause the audio to be resampled by the audio driver.

This method works by adjusting the dwScale and dwRate values in the AVISTREAMHEADER structure.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Strmif.h (include Dshow.h)

Library

Strmiids.lib

See also

AVI RIFF File Reference
Error and Success Codes
IConfigAviMux Interface

 

 

Community Additions

ADD
Show:
© 2014 Microsoft