To Edit Metadata with the Writer

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

You can access, directly from the writer, the metadata that will go into the header of the file. Call the QueryInterface method of any interface in the writer object to obtain a pointer to the IWMHeaderInfo or IWMHeaderInfo2 interface. After you have a pointer to the appropriate interface, you can manipulate the metadata just as you would if you had loaded the file in the metadata editor object. For more information about editing metadata, see Working with Metadata.

You must make all changes to the metadata before calling IWMWriter::BeginWriting.

Note

If you set metadata for a file, write the file, and then prepare to write a new file without releasing the writer, some metadata that was set for the first file will remain set and will be included with subsequent files. When writing several files with the same instance of the writer object, you have two options: check all the metadata before writing each file, or only write in the writer metadata that applies to all of the files you are writing.

 

Writing ASF Files