Managing Packet Size
[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 writer is designed to manage the size of packets internally. However, you may have specific requirements for your application that call for some manual control over the size of packets in the ASF files that you write. The Windows Media Format SDK provides two interfaces, IWMPacketSize and IWMPacketSize2 that enable you to control the maximum and minimum size of packets.
Both packet size interfaces are exposed in the profile object. They are also available to the reader object. As with other profile-related interfaces, the reader can access only the reading methods.
The size of packets has some effect on performance. In general, the smaller the packet size, the more fragmented the data is within a file. The more fragmented a file is, the less efficient it will be to reconstruct it. In a streaming scenario, this may not be an important consideration, as the process of reading a file from an Internet source is generally inefficient. When dealing with a file locally however, this might be a consideration.
Related topics