WM ASF Writer Filter (Windows Media Format 11 SDK)

[The feature associated with this page, Windows Media Format 11 SDK, is a legacy feature. It has been superseded by Source Reader and Sink Writer. Source Reader and Sink Writer have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use Source Reader and Sink Writer instead of Windows Media Format 11 SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The WM ASF Writer filter accepts a variable number of input streams and creates an ASF file. The filter handles all compression and multiplexing (although the compression mechanism can be bypassed). You can use the WM ASF Writer filter in various scenarios including digital video (DV) capture, audio recompression, and conversion of Audio-Video Interleaved (AVI) or MPEG digital media files for network streaming. This filter provides the only way to create Microsoft Windows Media Audio and Windows Media Video files in DirectShow.

For more information, see Creating ASF Files in DirectShow.

The following table contains information about the WM ASF Writer filter, such as the interfaces and media types it supports.

Filter Information Types
Filter interfaces IAMFilterMiscFlags, IBaseFilter, IConfigAsfWriter, IFileSinkFilter2, IMediaSeeking, IPersistStream, IServiceProvider, ISpecifyPropertyPages, IWMIndexer2, IWMHeaderInfo, IWMWriterAdvanced2
Input pin media types Dependent on the profile. Typically uncompressed types like MEDIATYPE_Audio or MEDIATYPE_Video, although compressed types can be accepted if they match the profile
Input pin interfaces IPin, IMemInputPin, IAMStreamConfig, IServiceProvider, IAMWMBufferPass, IWMStreamConfig2 (through IServiceProvider)
Output pin media types Not applicable
Output pin interfaces Not applicable
Filter CLSID CLSID_WMAsfWriter
Property page CLSID CLSID_WMAsfWriterProperties
Executable Qasf.dll
Merit MERIT_DO_NOT_USE
Filter Category Not specified

 

Remarks

The number of input pins on the filter depends on the profile that is passed to the filter. One pin of the appropriate media type is created for each stream defined in the profile.

The input pins support one method from the IAMStreamConfig interface: IAMStreamConfig::GetFormat. All other methods return E_NOTIMPL. Call the GetFormat method to query the pin's destination compression format, which is defined by the current profile. Use the IConfigAsfWriter interface to set the profile.

The filter's IServiceProvider interface enables applications to retrieve the IWMWriterAdvanced2 interface, which is defined in the Windows Media Format SDK. The IWMWriterAdvanced2 interface controls video deinterlacing, and is useful if the input is an interlaced source, such as DV (digital video). Use the GetInputSetting and SetInputSetting methods to control deinterlacing. It is not recommended that clients use any of the other methods on this interface. This interface can only be obtained after the filter has been added to the filter graph. The following example shows how to query for this interface:

// Assume that m_pGraph is a valid IGraphBuilder interface pointer,
// and that pAsfWriter points to the IBaseFilter interface
// on the WM ASF Writer filter.

IServiceProvider *pProvider = NULL;
IWMWriterAdvanced2 *pWMWA2 = NULL;

hr = m_pGraph->AddFilter(pAsfWriter, L"WM ASF Writer");
...
hr = pAsfWriter->QueryInterface(IID_IServiceProvider, (void**)&pProvider)
if (SUCCEEDED(hr))
{
    hr = pProvider->QueryService(IID_IWMWriterAdvanced2,
        IID_IWMWriterAdvanced2, (void**)&pWMWA2);
    pProvider->Release();
}

DirectShow QASF Reference