3. ASF top-level Header Object
This section defines the various objects that comprise the ASF Header Object. Of the objects listed in this section, those described in sections 3.1
through 3.12 were also described in previous versions of this specification.
The Header Object is a container that holds any combination of the standard objects listed
in the following sections. A File Properties Object, a Header Extension Object and at least one Stream Properties Object are required to be present. Implementations shall ignore any objects that
they do not understand.
The Header Object is represented using the following structure.
Field name |
Field type |
Size (bits) |
Object ID |
GUID |
128 |
Object Size |
QWORD |
64 |
Number of Header Objects |
DWORD |
32 |
Reserved1 |
BYTE |
8 |
Reserved2 |
BYTE |
8 |
The fields are defined as follows:
- Object ID
- Specifies the GUID for the Header Object. This field shall be set to ASF_Header_Object.
- Object Size
- Specifies the size of the Header Object. This includes the sum of 24 bytes plus the size of the objects contained
in the Header Object. Valid values are at least 30 bytes.
- Number of Header Objects
- Specifies the number of objects contained within the Header Object, not including this one. In addition, the Header Extension Object (sections 3.4 and 4) is counted as exactly one object regardless of the
number of subobjects contained within it.
- Reserved1
- This field must be set to the value 0x01. ASF parsers may safely ignore this value.
- Reserved2
- This field must be set to the value 0x02. If the this value is different when read, the application should fail to source the content.
The File Properties Object defines the global characteristics of the combined digital media streams
found within the Data Object.
The File Properties Object is represented using the following structure.
Field name |
Field type |
Size (bits) |
Object ID |
GUID |
128 |
Object Size |
QWORD |
64 |
File ID |
GUID |
128 |
File Size |
QWORD |
64 |
Creation Date |
QWORD |
64 |
Data Packets Count |
QWORD |
64 |
Play Duration |
QWORD |
64 |
Send Duration |
QWORD |
64 |
Preroll |
QWORD |
64 |
Flags |
DWORD |
32 |
|
Broadcast Flag |
|
1 (LSB) |
Seekable Flag |
|
1 |
Reserved |
|
30 |
Minimum Data Packet Size |
DWORD |
32 |
Maximum Data Packet Size |
DWORD |
32 |
Maximum Bitrate |
DWORD |
32 |
The fields are defined as follows:
- Object ID
- Specifies the GUID for the File Properties Object. This field shall be set to ASF_File_Properties_Object.
- Object Size
- Specifies the size, in bytes, of the File Properties Object. Valid values are at least 104 bytes.
- File ID
- Specifies the unique identifier for this file. The value of this field
shall be regenerated every time the file is modified in any way. The value
of this field shall be identical to the value of the File ID field of the Data Object.
- File Size
- Specifies the size, in bytes, of the entire file. The value of this field
is invalid if the Broadcast Flag bit in the Flags field is set to 1.
- Creation Date
- Specifies the date and time of the initial creation of the file. The value
is given as the number of 100-nanosecond intervals since January 1, 1601,
according to Coordinated Universal Time (Greenwich Mean Time). The value
of this field may be invalid if the Broadcast Flag bit in the Flags field is set to 1.
- Data Packets Count
- Specifies the number of Data Packet entries that exist within the Data Object. The value of this field is invalid if the Broadcast Flag bit in the Flags field is set to 1.
- Play Duration
- Specifies the time needed to play the file in 100-nanosecond units. This value should include the duration (estimated, if an exact value is unavailable) of the the last media object in the presentation. The value of this field is invalid if the Broadcast Flag bit in the Flags field is set to 1.
- Send Duration
- Specifies the time needed to send the file in 100-nanosecond units. This value should include the duration of the last packet in the content. The value of this field is invalid if the Broadcast Flag bit in the Flags field is set to 1. Players can ignore this value.
- Preroll
- Specifies the amount of time to buffer data before starting to play the file, in millisecond units. If this value is nonzero, the Play Duration field and all of the payload Presentation Time fields have been offset by this amount. Therefore, player software must
subtract the value in the preroll field from the play duration and presentation
times to calculate their actual values.
It follows that all payload Presentation Time fields need to be at least this value.
- Flags
- The flags are stored in Least Significant Byte (LSB) order.
- Broadcast Flag (bit 0)
- Specifies, if set, that a file is in the process of being created (for example, for recording applications), and thus that various values stored in the header objects are invalid. It is highly recommended that post-processing be performed to remove this condition at the earliest opportunity.
- Seekable Flag (bit 1)
- Specifies, if set, that a file is seekable. Note that for files containing
a single audio stream and a Minimum Data Packet Size field equal to the Maximum Data Packet Size field, this flag shall always be set to 1. For files containing a single audio stream and a video stream or mutually exclusive video streams, this flag is only set to 1 if the file contains a matching Simple Index Object for each regular video stream (that is, video streams that are not hidden according to the method described in section 8.2.2).
- Reserved (bits 2 - 31)
- Remaining 30 reserved flags shall be set to 0.
- Minimum Data Packet Size
- Specifies the minimum Data Packet size in bytes. In general, the value
of this field is invalid if the Broadcast Flag bit in the Flags field is set to 1. However, for the purposes of this specification, the
values for the Minimum Data Packet Size and Maximum Data Packet Size fields shall be set to the same value, and this value should be set to the packet size, even when the Broadcast Flag in the Flags field is set to 1.
- Maximum Data Packet Size
- Specifies the maximum Data Packet size in bytes. In general, the value
of this field is invalid if the Broadcast Flag bit in the Flags field is set to 1. However, for the purposes of this specification, the values of the Minimum Data Packet Size and Maximum Data Packet Size fields shall be set to the same value, and this value should be set to
the packet size, even when the Broadcast Flag field is set to 1.
- Maximum Bitrate
- Specifies the maximum instantaneous bit rate in bits per second for the
entire file. This shall equal the sum of the bit rates of the individual
digital media streams. It shall be noted that the digital media stream
includes ASF data packetization overhead as well as digital media data
in payloads. Only those streams that have a free-standing Stream Properties Object in the header shall have their bit rates included in the sum; streams
whose Stream Properties Object exists as part of an Extended Stream Properties Object in the Header Extension Object shall not have their bit rates included in this sum, except when this
value would otherwise be 0.
The Stream Properties Object defines the specific properties and characteristics of a digital media stream. This object defines how a digital media stream within the Data Object is interpreted, as well as the specific format (of elements) of the Data Packet itself (for more information, see section 5.2).
Whereas every stream in an ASF presentation, including each stream in a
mutual exclusion relationship, must be represented by a Stream Properties Object, in certain cases, this object might be found embedded in the Extended Stream Properties Object (section 4.1). See section 8.2 for situations in which that should occur.
The Stream Properties Object is represented using the following structure.
Field
Name |
Field
Type |
Size
(bits) |
Object
ID |
GUID |
128 |
Object Size |
QWORD |
64 |
Stream Type |
GUID |
128 |
Error Correction Type |
GUID |
128 |
Time OffsetType-Specific Data Length |
QWORD |
64 |
DWORD |
32 |
Error Correction Data Length |
DWORD |
32 |
Flags |
WORD |
16 |
|
Stream Number |
|
7 (LSB) |
Reserved |
|
8 |
Encrypted Content Flag |
|
1 |
Reserved |
DWORD
|
7
(LSB)
|
Type-Specific Data |
BYTE |
varies |
Error Correction Data |
BYTE |
varies |
The
fields are defined as follows:
- Object ID
- Specifies the GUID for the Stream Properties Object. The value of this field shall be set to ASF_Stream_Properties_Object.
- Object Size
- Specifies the size, in bytes, of the Stream Properties Object. Valid values are at least 78 bytes.
- Stream Type
- Specifies the type of the stream (for example, audio, video, and so on). Use one of the GUIDs defined in section 10.4. Any streams with unrecognized Stream Type values should be ignored.
- Error Correction Type
- Specifies the error correction type used by this digital media stream.
For streams other than audio, this value should be set to ASF_No_Error_Correction. For audio streams, this value should be set to ASF_Audio_Spread. The possible GUIDs are defined in section 10.5, and the standard error correction schemes are described in section 9.1.
- Time Offset
- Specifies the presentation time offset of the stream in 100-nanosecond units. The value of this field is added to all of the timestamps of the samples in the stream. This value shall be equal to the send time of the first interleaved packet in the data section. The value of this field is typically 0. It is non-zero in the case when an ASF file is edited and it is not possible for the editor to change the presentation times and send times of ASF packets. Note that if more than one stream is present in an ASF file the offset values of all stream properties objects must be equal.
- Type-Specific Data Length
- Specifies the number of bytes in the Type-Specific Data field.
- Error Correction Data Length
- Specifies the number of bytes in the Error Correction Data field.
- Flags
- The flags are stored in LSB order.
- Stream Number (bits 0-6)
- Specifies the number of this stream. 0 is an invalid stream. Valid values are between 1 and 127. The numbers assigned to streams in an ASF presentation may be any combination of unique values; parsing logic must not assume that streams are numbered sequentially.
- Reserved (bits 7-14)
- These bits are reserved and should be set to 0.
- Encrypted Content Flag (bit 15)
- Specifies, if set, that the data contained in this stream is encrypted and will be unreadable unless there is a way to decrypt the stream.
- Reserved
- This field is reserved and should be set to 0.
- Type-Specific Data
- Specifies type-specific format data. The structure for the Type-Specific Data field is determined by the value stored in the Stream Type field. The structure for the Type-Specific Data field for standard ASF media types is detailed in section 9.
- Error Correction Data
- Specifies data specific to the error correction type. The structure for
the Error Correction Data field is determined by the value stored in the Error Correction Type field. For example, an audio data stream might need to know how codec
chunks were redistributed, or it might need a sample of encoded silence.
For detailed information, see section 9.1.
The Header Extension Object allows additional functionality to be added to an ASF file while maintaining backward compatibility. The Header Extension Object is a container containing 0 or more additional extended header objects. Extended header objects should conform to the ASF Object Structure (per section 2.1). For more information, see section 8.2.1.
The Header Extension Object is represented using the following structure.
Field
Name |
Field
Type |
Size
(bits) |
Object
ID |
GUID |
128 |
Object Size |
QWORD |
64 |
Reserved Field 1 |
GUID |
128 |
Reserved Field 2 |
WORD |
16 |
Header Extension Data Size |
DWORD |
32 |
Header Extension Data |
BYTE |
varies |
The
fields are defined as follows:
- Object ID
- Specifies the GUID for the Header Extension Object. The value of this field shall be set to ASF_Header_Extension_Object.
- Object Size
- Specifies the size, in bytes, of the Header Extension Object. The value of this field shall be set to 46 bytes.
- Reserved Field 1
- This value shall be set to ASF_Reserved_1 as defined in section 10.6.
- Reserved Field 2
- This value should be set to 6.
- Header Extension Data Size
- Specifies the number of bytes stored in the Header Extension Data field. This value may be 0 bytes or 24 bytes and larger. It should also
be equal to the Object Size field minus 46 bytes.
- Header Extension Data
- Specifies an array of bytes containing additional extended header objects. This data should be interpreted as 0 or more extended header objects stored consecutively within the array of bytes. No empty space, padding, leading, or trailing bytes are allowed.
The Codec List Object provides user-friendly information about the codecs and formats used to
encode the content found in the ASF file. The Codec List Object is represented using the following structure.
Field
name |
Field
type |
Size
(bits) |
Object
ID |
GUID |
128 |
Object Size |
QWORD |
64 |
Reserved |
GUID |
128 |
Codec Entries Count |
DWORD |
32 |
Codec Entries |
See below |
varies |
The
fields are defined as follows:
- Object ID
- Specifies the GUID for the Codec List Object. The value of this field shall be set to ASF_Codec_List_Object.
- Object Size
- Specifies the size, in bytes, of the Codec List Object. Valid values are at least 44 bytes.
- Reserved
- Reserved. This field shall be set to ASF_Reserved_2 as defined in section 10.8.
- Codec Entries Count
- Specifies the number of entries listed in the Codec Entries field.
- Codec Entries
- Codec Entries are described in the following table.
Field
Name |
Field
Type |
Size
(bits) |
Type |
WORD |
16 |
Codec Name
Length |
WORD |
16 |
Codec Name |
WCHAR |
varies |
Codec
Description Length |
WORD |
16 |
Codec
Description |
WCHAR |
varies |
Codec
Information Length |
WORD |
16 |
Codec
Information |
BYTE |
varies |
The
fields are defined as follows:
- Type
- Specifies the type of the codec used. Use one of the values in the following table.
Values |
Meaning |
0x0001 |
Video
codec |
0x0002 |
Audio codec |
0xFFFF |
Unknown
codec |
- Codec Name Length
- Specifies the number of Unicode characters stored in the Codec Name field.
- Codec Name
- Specifies an array of Unicode characters that contains the name of the codec used to create the content.
- Codec Description Length
- Specifies the number of Unicode characters stored in the Codec Description field.
- Codec Description
- Specifies an array of Unicode characters that contains the description of the format used to create the content.
- Codec Information Length
- Specifies the number of bytes stored in the Codec Information field.
- Codec Information
- Specifies an opaque array of information bytes about the codec used to create the content. The meaning of these bytes is determined by the codec.
The Script Command Object provides a list of type/parameter pairs of Unicode strings that are synchronized
to the ASF file’s timeline. Types can include URL or FILENAME values.
Other type values may also be freely defined and used. The semantics and
treatment of this set of types are defined by the local implementations.
The parameter value (referred to as Commands in the follwoing table) is
specific to the type field. You can use this type/parameter pairing for
many purposes, including sending URLs to be launched by a client into an
HTML frame (in other words, the URL type) or launching another ASF file
for the chained continuous play of audio or video presentations (in other
words, the FILENAME type). This object is also used as a method to stream
text, as well as to provide script commands that you can use to control
elements within the client environment.
The Script Command Object is represented using the following structure.
Field name |
Field type |
Size (bits) |
Object ID |
GUID |
128 |
Object Size |
QWORD |
64 |
Reserved |
GUID |
128 |
Commands Count |
WORD |
16 |
Command Types Count |
WORD |
16 |
Command Types |
See below |
varies |
Commands |
See below |
varies |
The fields are defined as follows:
- Object ID
- Specifies the GUID for the Script Command Object. The value of this field shall be set to ASF_Script_Command_Object.
- Object Size
- Specifies the size, in bytes, of the Script Command Object. Valid values are at least 44 bytes.
- Reserved
- Reserved. This field shall be set to ASF_Reserved_3 as defined in section 10.9.
- Commands Count
- Specifies the number of Command structures in the Script Command Object.
- Command Types Count
- Specifies the number of Command Type structures in the Script Command Object.
- Command Types
- The structure of each Command Type entry is shown in the following table.
Field name |
Field type |
Size (bits) |
Command Type Name Length |
WORD |
16 |
Command Type Name |
WCHAR |
varies |
- Command Type Name Length
- Specifies the number of Unicode characters that are found within the Command Type Name field.
- Command Type Name
- Specifies the name of a type of command. Whereas it is highly recommended that this string include a nul-terminator, the nul-terminator may not be present.
- Commands
- The structure of each Command entry is shown in the following table.
Field
name |
Field
type |
Size
(bits) |
Presentation
Time |
DWORD |
32 |
Type Index |
WORD |
16 |
Command Name
Length |
WORD |
16 |
Command
Name |
WCHAR |
varies |
- Presentation Time
- Specifies the presentation time of the command, in milliseconds.
- Type Index
- Specifies the type of this command, as a zero-based index into the array of Command Types of this object.
- Command Name Length
- Specifies the number of Unicode characters that are found within the Command Name field.
- Command Name
- Specifies the name of this command. Whereas it is highly recommended that this string include a nul-terminator, the nul-terminator may not be present.
The Marker Object is represented using the following structure.
Field
name |
Field
type |
Size
(bits) |
Object
ID |
GUID |
128 |
Object Size |
QWORD |
64 |
Reserved |
GUID |
128 |
Markers Count |
DWORD |
32 |
Reserved |
WORD |
16 |
Name Length |
WORD |
16 |
Name |
WCHAR |
varies |
Markers |
See
below |
varies |
The
fields are defined as follows:
- Object ID
- Specifies the GUID for the Marker Object. The value of this field shall be set to ASF_Marker_Object.
- Object Size
- Specifies the size, in bytes, of the Marker Object. Valid values are at least 48 bytes.
- Reserved
- Reserved. This field shall be set to ASF_Reserved_4 as defined in section 10.10.
- Markers Count
- Specifies the number of Marker structures in the Marker Object.
- Reserved
- Specifies a reserved field. This field shall be set to 0.
- Name Length
- Specifies the number of bytes that are found within the Name field.
- Name
- Specifies the name of the Marker Object. Whereas it is highly recommended that this string include a nul-terminator,
the nul-terminator may not be present.
- Markers
- The structure of each Marker entry is shown in the following table.
Field
name |
Field
type |
Size
(bits) |
Offset |
QWORD |
64 |
Presentation
Time |
QWORD |
64 |
Entry Length |
WORD |
16 |
Send Time |
DWORD |
32 |
Flags |
DWORD |
32 |
Marker
Description Length |
DWORD |
32 |
Marker
Description |
WCHAR |
varies |
The fields are defined as follows:
- Offset
- Specifies a byte offset into the Data Object to the actual position of the marker in the Data Object. ASF parsers must seek to this position to properly display data at the
specified marker Presentation Time.
- Presentation Time
- Specifies the presentation time of the marker, in 100-nanosecond units.
- Entry Length
- Specifies the length in bytes of the Send Time, Flags, and Marker Description Length fields, and the number of bytes stored in the Marker Description field. (Note that the last version of this specification allowed for this
field to optionally include some padding bytes at the end of the Marker entry in addition to the sizes of the aforementioned fields. This was
not correct; the value of this field needs to be exactly the size of the
Send Time, Flags, and Marker Description Length fields plus the number of bytes stored in the Marker Description field.)
- Send Time
- Specifies the send time of the marker entry, in milliseconds.
- Flags
- Flags are reserved and should be set to 0.
- Marker Description Length
- Specifies the number of WCHARs that are found within the Marker Description field (including the nul-terminating character, if present). (Note that
the last version of this specification indicated that this value is equal
to the number of bytes that are found within the Marker Description field. This was not correct; this value is the number of WCHARs.)
- Marker Description
- Specifies an array of WCHARs containing a description of the marker entry. Whereas it is highly recommended that this string include a nul-terminator, the nul-terminator may not be present.
The Bitrate
Mutual
Exclusion Object
identifies video streams that have a mutual exclusion relationship to
each other (in other words, only one of the streams within such a
relationship can be streamed at any given time and the rest are
ignored). One instance of this object must be present for each set of
objects that contains a mutual exclusion relationship. All video
streams in this relationship must have the same frame size. The
exclusion type is used so that implementations can allow user
selection of common choices, such as bit rate.
The Bitrate Mutual Exclusion Object is represented using the following structure.
Field
name |
Field
type |
Size
(bits) |
Object
ID |
GUID |
128 |
Object Size |
QWORD |
64 |
Exclusion Type |
GUID |
128 |
Stream Numbers Count |
WORD |
16 |
Stream Numbers |
WORD |
varies |
The fields are defined as follows:
- Object ID
- Specifies the GUID for the Mutual Exclusion Object. The value of this field shall be set to ASF_Bitrate_Mutual_Exclusion_Object.
- Object Size
- Specifies the size, in bytes, of the Bitrate Mutual Exclusion Object. Valid values are at least 42 bytes.
- Exclusion Type
- Specifies the nature of the mutual exclusion relationship. Use one of the GUIDs defined in section 10.11.
- Stream Numbers Count
- Specifies the number of video streams listed in the Stream Numbers field.
- Stream Numbers
- Specifies
the list of mutually exclusive video stream numbers. Valid values are
between 1 and 127
as defined in the Stream Properties Object.
The Error Correction Object defines the error correction method. This enables different error correction schemes to be used during content creation. The Error Correction Object contains provisions for opaque information needed by the error correction engine for recovery. For example, if the error correction scheme were a simple N+1 parity scheme, then the value of N would have to be available in this object.
Note that this does not refer to the same thing as the Error Correction Type field in the Stream Properties Object. Rather, this object indicates the error correction scheme used for the
ASF packets as described in section 5.2.1.
The Error Correction Object is represented using the following structure.
Field
name |
Field
type |
Size
(bits) |
Object
ID |
GUID |
128 |
Object Size |
QWORD |
64 |
Error Correction Type |
GUID |
128 |
Error Correction Data Length |
DWORD |
32 |
Error Correction Data |
BYTE |
varies |
The fields are defined as follows:
- Object ID
- Specifies the GUID for the Error Correction Object. The value of this field shall be set to ASF_Error_Correction_Object.
- Object Size
- Specifies the size, in bytes, of the Error Correction Object. Valid values are at least 44 bytes.
- Error Correction Type
- Specifies the type of error correction.
- Error Correction Data Length
- Specifies the length, in bytes, of the Error Correction Data field.
- Error Correction Data
- Specifies data specific to the error correction scheme. The structure for
the Error Correction Data field is determined by the value stored in the Error Correction Type field.
The Content Description Object lets authors record well-known data describing the file and its contents.
This object is used to store standard bibliographic information such as
title, author, copyright, description, and rating information. This information
is pertinent to the entire file.
The Content Description Object is represented using the following structure.
Field
name |
Field
type |
Size
(bits) |
Object
ID |
GUID |
128 |
Object Size |
QWORD |
64 |
Title Length |
WORD |
16 |
Author Length |
WORD |
16 |
Copyright Length |
WORD |
16 |
Description Length |
WORD |
16 |
Rating Length |
WORD |
16 |
Title |
WCHAR |
Varies |
Author |
WCHAR |
Varies |
Copyright |
WCHAR |
Varies |
Description |
WCHAR |
Varies |
Rating |
WCHAR |
Varies |
The fields are defined as follows:
- Object ID
- Specifies the GUID for the Content Description Object. The value of this field shall be set to ASF_Content_Description_Object.
- Object Size
- Specifies the size, in bytes, of the Content Description Object. Valid values are at least 34 bytes.
- Title Length
- Specifies the number of bytes that comprise the title information stored
in the Title field.
- Author Length
- Specifies the number of bytes that comprise the author information stored in the Author field.
- Copyright Length
- Specifies the number of bytes that comprise the copyright information stored in the Copyright field.
- Description Length
- Specifies the number of bytes that comprise the description information
stored in the Description field.
- Rating Length
- Specifies the number of bytes that comprise the rating information stored
in the Rating field.
- Title
- Specifies an array of WCHARs that contains the title information. Whereas it is highly recommended that this string include a nul-terminator, the nul-terminator may not be present.
- Author
- Specifies an array of WCHARs that contains the author information. Whereas it is highly recommended that this string include a nul-terminator, the nul-terminator may not be present.
- Copyright
- Specifies an array of WCHARs that contains the copyright information. Whereas it is highly recommended that this string include a nul-terminator, the nul-terminator may not be present.
- Description
- Specifies an array of WCHARs that contains the description information. Whereas it is highly recommended that this string include a nul-terminator, the nul-terminator may not be present.
- Rating
- Specifies an array of WCHARs that contains the rating information. Whereas it is highly recommended that this string include a nul-terminator, the nul-terminator may not be present.
The Extended Content Description Object lets authors record data describing the file and its contents that is
beyond the standard bibliographic information such as title, author, copyright,
description, or rating information. This information is pertinent to the
whole file. Each Content Descriptor stored in this object uses a name/value pair metaphor.
For more information about what types of attributes belong in the Extended Content Description Object, see section 7.4.
The Extended Content Description Object is represented using the following structure.
Field
name |
Field
type |
Size
(bits) |
Object
ID |
GUID |
128 |
Object Size |
QWORD |
64 |
Content Descriptors Count |
WORD |
16 |
Content
Descriptors |
See
text |
varies |
The fields are defined as follows:
- Object ID
- Specifie the GUID for the Extended Content Description Object. The value of this field shall be set to
ASF_Extended_Content_Description_Object.
- Object Size
- Specifies the size, in bytes, of the Extended Content Description Object. Valid values are at least 26 bytes.
- Content Descriptors Count
- Specifies the number of entries in the Content Descriptors list.
- Content Descriptors
- The structure of each Content Descriptor entry is shown in the following table.
Field
Name |
Field
Type |
Size
(bits) |
Descriptor
Name Length |
WORD |
16 |
Descriptor
Name |
WCHAR |
varies |
Descriptor
Value Data Type |
WORD |
16 |
Descriptor
Value Length |
WORD |
16 |
Descriptor
Value |
See
text |
varies |
The fields are defined as follows:
- Descriptor Name Length
- Specifies the size, in bytes, of the Descriptor Name field.
- Descriptor Name
- Specifies an array of Unicode characters that contains the name of the descriptor.
- Descriptor Value Data Type
- Specifies the type of data stored in the Descriptor Value field. The types are defined in the following table.
Value |
Type |
Descriptor
value length |
0x0000 |
Unicode
string |
varies |
0x0001 |
BYTE array |
varies |
0x0002 |
BOOL |
32 |
0x0003 |
DWORD |
32 |
0x0004 |
QWORD |
64 |
0x0005 |
WORD |
16 |
- Descriptor Value Length
- Specifies the number of bytes stored in the Descriptor Value field. For sizes, see the table in the Descriptor Value Data Type section.
- Descriptor Value
- Specifies the value for the Content Descriptor field. The type for this value is determined by the Descriptor Value Data Type field.
The Stream Bitrate Properties Object defines the average bit rate of each digital media stream. It is represented
using the following structure.
Field
name |
Field
type |
Size
(bits) |
Object
ID |
GUID |
128 |
Object Size |
QWORD |
64 |
Bitrate Records Count |
WORD |
16 |
Bitrate Records |
See below |
varies |
The fields are defined as follows:
- Object ID
- Specifies the GUID for the Stream Bitrate Properties Object. The value of this field shall be set to ASF_Stream_Bitrate_Properties_Object.
- Object Size
- Specifies the size, in bytes, of the Stream Bitrate Properties Object. Valid values are at least 26 bytes.
- Bitrate Records Count
- Specifies the number of records listed in the Bitrate Records field.
- Bitrate Records
- The structure of each Bitrate Record entry is shown in the following table.
Field
name |
Field
type |
Size
(bits) |
Flags |
WORD |
16 |
|
Stream Number |
|
7 (LSB) |
Reserved |
|
9 |
Average Bitrate |
DWORD |
32 |
The fields are defined as follows:
- Flags
- The flags are stored in LSB order.
- Stream Number (bits 0-6)
- Specifies the number of this stream described by this record. 0 is an invalid stream. Valid values are between 1 and 127.
- Reserved (bits 7-15)
- These bits are reserved and should be set to 0.
- Average Bitrate
- Specifies the average bit rate of the stream in bits per second. This value should include an estimate of ASF packet and payload overhead associated with this stream.
The Content Branding Object stores branding data for an ASF file, including information about a banner image and copyright associated with the file. It is represented using the following structure.
Field
name |
Field
type |
Size
(bits) |
Object
ID |
GUID |
128 |
Object Size |
QWORD |
64 |
Banner Image Type |
DWORD |
32 |
Banner Image Data Size |
DWORD |
32 |
Banner Image Data |
BYTE |
varies |
Banner Image URL Length |
DWORD |
32 |
Banner Image URL |
char |
varies |
Copyright URL Length |
DWORD |
32 |
Copyright URL |
char |
varies |
The fields are defined as follows:
- Object ID
- Specifies the GUID for the Content Branding Object. The value of this field shall be set to ASF_Content_Branding_Object.
- Object Size
- Specifies the size, in bytes, of the Content Branding Object. Valid values are at least 40 bytes.
- Banner Image Type
- Specifies
the type of data contained in the Banner
Image Data. Valid values are
0 to indicate that there is no banner image data;
1 to indicate that the data represent a bitmap;
2 to indicate that the data represents a JPEG; and
3 to indicate that the data represents a GIF.
If this value is set to 0, then the Banner Image Data Size field must be set to 0, and the Banner Image Data field must be empty.
- Banner Image Data Size
- Specifies the number of bytes in the Banner Image Data field.
- Banner Image Data
- This field contains the entire banner image, including the header for the appropriate image format.
- Banner Image URL Length
- Specifies the nuber of bytes in the Banner Image URL feld.
- Banner Image URL
- Contains an ASCII (not WCHAR) string. If present, it is a link to more information about the banner image.
- Copyright URL Length
- Specifies the number of bytes in the Copyright URL field.
- Copyright URL
- Contains an ASCII (not WCHAR) string. If present, it is a link to more information about the copyright for the content.
The Content Encryption Object lets authors protect content by using Microsoft® Digital Rights Manager version 1. It is represented using the following structure.
Field
name |
Field
type |
Size
(bits) |
Object
ID |
GUID |
128 |
Object Size |
QWORD |
64 |
Secret Data Length |
DWORD |
32 |
Secret Data |
BYTE |
varies |
Protection Type Length |
DWORD |
32 |
Protection Type |
char |
varies |
Key ID Length |
DWORD |
32 |
Key ID |
char |
varies |
License URL Length |
DWORD |
32 |
License
URL |
char |
varies |
The
fields are defined as follows:
- Object ID
- Specifies the GUID for the Content Encryption Object. The value of this field shall be set to ASF_Content_Encryption_Object.
- Object Size
- Specifies the size, in bytes, of the Content Encryption Object. Valid values are larger than 40 bytes.
- Secret Data Length
- Specifies the number of bytes stored in the Secret Data field.
- Secret Data
- Specifies an array of bytes containing secret data.
- Protection Type Length
- Specifies the length in bytes of the Protection Type field.
- Protection Type
- Specifies a nul-terminated array of ASCII characters (not WCHARs) describing
the type of protection mechanism used. The value of this field shall be
set to “DRM”.
- Key ID Length
- Specifies the length in bytes of the Key ID field.
- Key ID
- Specifies a nul-terminated array of ASCII characters (not WCHARs) describing the key ID used.
- License URL Length
- Specifies the length in bytes of the License URL field.
- License URL
- Specifies a nul-terminated array of ASCII characters (not WCHARs) containing the URL from which a license to manipulate the content can be acquired.
The Extended Content Encryption Object lets authors protect content by using the Windows Media Rights Manager
7 Software Development Kit (SDK). It is represented using the following
structure.
Field
name |
Field
type |
Size
(bits) |
Object
ID |
GUID |
128 |
Object Size |
QWORD |
64 |
Data
Size |
DWORD |
32 |
Data |
BYTE |
varies |
The fields are defined as follows:
- Object ID
- Specifies the GUID for the Extended Content Encryption Object. The value of this field shall be set to ASF_Extended_Content_Encryption_Object.
- Object Size
- Specifies the size, in bytes, of the Extended Content Encryption Object. Valid values are larger than 24 bytes.
- Data Size
- Specifies the length, in bytes, of the data contained in the Data field.
- Data
- Specifies an array of bytes required by the DRM client to manipulate the protected content.
The Digital Signature Object lets authors sign the portion of their header that lies between the end
of the File Properties Object and the beginning of the Digital Signature Object. It is represented using the following structure.
Field
name |
Field
type |
Size
(bits) |
Object
ID |
GUID |
128 |
Object Size |
QWORD |
64 |
Signature Type |
DWORD |
32 |
Signature Data Length |
DWORD |
32 |
Signature
Data |
BYTE |
varies |
The fields are defined as follows:
- Object ID
- Specifies the GUID for the Digital Signature Object. The value of this field shall be set to ASF_Digital_Signature_Object.
- Object Size
- Specifies the size, in bytes, of the Digital Signature Object. Valid values are larger than 32 bytes.
- Signature Type
- Specifies the type of digital signature used. This field shall be set to 2.
- Signature Data Length
- Specifies the number of bytes stored in the Signature Data field.
- Signature Data
- Specifies an array of bytes containing the digital signature.
The Padding Object is a dummy object that is used to pad the size of the Header Object. This object enables the size of any object stored in the Header Object to grow or shrink without having to rewrite the entire Data Object and Index Object sections of the ASF file. For instance, if entries in the Content Description Object or Extended Content Description Object need to be removed or shortened, the size of the Padding Object can be increased to compensate for the reduction in size of the Content Description Object. The ASF file can then be updated by overwriting the previous Header
Object with the edited Header Object of identical size, without having to move or rewrite the data contained in the Data Object. Playback applications shall simply ignore Padding Objects. The Padding Object is represented using the following structure.
Field
name |
Field
type |
Size
(bits) |
Object
ID |
GUID |
128 |
Object Size |
QWORD |
64 |
Padding
Data |
BYTE |
varies |
The fields are defined as follows:
- Object ID
- Specifies the GUID for the Padding Object. The value of this field shall be set to ASF_Padding_Object.
- Object Size
- Specifies the size, in bytes, of the Padding Object. Valid values are at least 24 bytes.
- Padding Data
- Specifies an array of bytes used for padding purposes. The length of the
padding object data is calculated as Object Size
- 24 bytes (sizeof(Object ID) + sizeof(Object Size)). As the name implies, the Padding Data field contains padding instead of meaningful data and shall always be
ignored.