SMPTE Time Code Support

[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 Windows Media Format SDK provides limited support for SMPTE time code, which is a standard time code format for movies and television. You can include SMPTE time code data with samples as data unit extensions. The data portion of the extension is a WMT_TIMECODE_EXTENSION_DATA structure containing the information from the original SMPTE time stamp.

Maintaining SMPTE time code in your ASF files comes with performance limits. Each sample with an associated SMPTE time stamp requires transport of the 14 bytes in the time stamp structure. In a streaming scenario, this increased bandwidth requirement could be catastrophic. As a result, it is suggested that SMPTE time codes only be persisted in ASF files during the video editing process, which is typically done with local files. When the final file is created, you should remove the data unit extensions.

You can read SMPTE time stamps just as you would read any other data unit extension, but the reading objects provide integrated support for searching by SMPTE time code. To be able to search for SMPTE time stamps, you must first index the file by SMPTE time code. You can configure the indexer to index time codes by using the IWMIndexer2::Configure method.

Using the asynchronous reader, you can navigate a file by SMPTE time stamps using the methods of the IWMReaderTimecode interface and the IWMReaderAdvanced3::StartAtPosition method. With the synchronous reader, use IWMSyncReader2::SetRangeByTimecode.

ASF File Features

Configuring Data Unit Extensions