Arbitrary and Precompressed Stream Inputs

[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.]

Only inputs that are to be compressed by one of the Windows Media codecs have multiple possible inputs. The other types of possible inputs are arbitrary inputs and precompressed inputs. The requirements for input formats for these types are described in this section.

Arbitrary Stream Inputs

Inputs for arbitrary stream types are the same as the stream formats described in the profile. You should not have to set input formats for these types.

Precompressed Stream Inputs

When copying a stream from one file to another, you pass samples that are already compressed. In this case, you must set the input properties object to NULL to inform the writer that it does not need to validate the data you are passing in. To set the input format to NULL, call IWMWriter::SetInputProps and pass NULL as the second parameter. When calling this method with a NULL parameter, you must make the call before calling BeginWriting.

When using precompressed streams, you must manually copy codec information to the file header before writing. To obtain the codec information, call IWMHeaderInfo2::GetCodecInfoCount and IWMHeaderInfo2::GetCodecInfo to enumerate the codecs associated with the file in the reader. Select the codec information that matches the stream configuration of the precompressed stream. Then set the codec information in the writer by calling IWMHeaderInfo3::AddCodecInfo, passing the information obtained from the reader.

Working with Inputs