ASF File Format

Source: Internet
Author: User

ASF is(Advanced Streaming Format)Microsoft developed for Windows 98.
File format. This word can be used with WMA and WMV.

ASF is an open standard that relies on multiple protocols to support data transmission in multiple network environments. Same
Like jpg and MPG files, ASF files are also a file type, but they are designed to transfer Synchronized Multimedia Data on the IP network, therefore, information in ASF format is especially suitable for transmission over IP networks. The content of the ASF file can be either a common file we are familiar with, or a continuous data stream generated by the encoding device in real time. Therefore, ASF can transmit programs recorded in advance, you can also transmit programs generated in real time.

ASF is used to arrange, organize, and synchronize multimedia data for transmission over the network. ASF is a data format that can be used to specify a live demo. ASF is most suitable for sending Multimedia Streams over the network and playing locally. Any compression/decompression algorithm (decoder) can be used to encode the ASF stream.

The core of Windows Media Service is ASF. ASF is a data format in which multimedia information, such as audio, video, image, and Control Command Script, is transmitted in the form of network packets to publish streaming multimedia content. The content transmitted over the network is called ASF stream. ASF supports arbitrary compression/Decompression encoding methods, and can use any underlying network transmission protocol, with great flexibility.

Microsoft Media Player is a player that can play almost all multimedia files. It supports the stream file format of ASF on the Internet. It can be downloaded and played in real time without the need to download and listen again.

 

WMA file format, that is, ASF format

Header object

File properties object

Stream properties object 1

...

Stream properties object n

<Other header objects>

Data Object

Data Packet 1

...

Data Packet m

<Other top-level objects>

Index object 1

...

Index object K

Simple index object 1

...

Simple index object L

Simple Description of the format:

1. asfhead:

Asf_header_object = 75b22630-668e-11cf-a6d9-00aa0062ce6c (16 byte)

1. For each WMA file, its header 16 bytes are fixed, for the hexadecimal "30 26 B2 75 8e 66 CF 11 A6 D9 00 AA 00 62 ce 6C ", used to identify whether the file is a WMA file. The next 8 bytes are an integer that indicates the size of the header of the entire WMA file. The header contains all non-Audio Information such as tag information, followed by Audio Information, we will not go into details here. The number of next four byte frames of the integer. The number of two bytes is unknown.

Field name

Field Type

Size (bytes)

Description

Object ID

Guid

16

Is the serial number of the above object

Object size

Qword

8

ASF head size (including the above 24 bytes)

Number of header objects

DWORD

4

Head count

Reserved1

Byte

1

Reserved2

Byte

1

That is to say, the offset starting from the file is 31, which stores many frames, including the standard tag information, Extended Tag Information, and WMA file control information. Each frame is not of an equal length, but the frame header is fixed to 24 bytes.

Asf_file_properties_object = 8cabdca1-a947-11cf-8ee4-00c00c205365 (16 byte)

Field name

Field Type

Size (BITs)

Description

Object ID

Guid

128

8cabdca1-a947-11cf-8ee4-00c00c205365

Object size

Qword

64

The size of this frame (including the frame header)

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

2. ASF Data Object

The data object is represented using the following structure.

Field name

Field Type

Size (bytes)

Object ID

Guid

16

Object size

Qword

8

File ID

Guid

16

Total data packets

Qword

8

Reserved

Word

2

Data Packets

See section 5.2

Varies

Data Object (not loaded) (9435146 bytes)

Property

Value

File position

3471 (0xd8f)

Object ID

75b22636-668e-11cf-a6d9-00aa0062ce6c

Object size

9435146 (0x8ff80a)

MMS ID

68e9598c-336e-471d-8f2f-576e11e037c5

Packets

3267

Alignment

1

Packet aligment

1

Raw data dump

Size

50 (0x32)

Data

0000: 36 26 B2 75 8e 66 CF 11-a6 D9 00 AA 00 62 ce 6C 6 & U F B L
0010: 0a F8 8f 00 00 00 00-8c 59 E9 68 6e 33 1D 47 y hn3 g
0020: 8f 2f 57 6e 11 E0 37 c5-c3 0C 00 00 00 00 00/WN 7
0030: 01 01

HTTP interaction process:

GET/xfm2003/Video/Morrissey _-_ first_of_the_gang_to_die_hi.wmv HTTP/1.0

Accept :*/*

User-Agent: nsplayer/9.0.0.3250

HOST: 195.173.73.27

X-Accept-Authentication: negotiate, NTLM, digest, basic

Pragma: No-cache, rate = 1.000, stream-time = 0, stream-offset = 4294967295: 4294967295, packet-num = 4294967295, Max-duration = 0

Pragma: xplaystrm = 1

Pragma: xclientguid = {3300ad50-2c39-46c0-ae0a-ef4916e929d5}

Pragma: Stream-switch-Count = 3

Pragma: Stream-switch-entry = FFFF: 1: 0 FFFF: 2: 2 FFFF: 3: 0

Accept-language: En-GB, *; q = 0.1

HTTP/1.0 200 OK

Content-Type: Application/octet-stream

Server: cougar 4.1.0.3857

Via: netcache1-new (netcache netapp/5.6.2r1d17)

Cache-control: No-Cache

Pragma: No-Cache

Pragma: client-id = 5382809

Pragma: features = "seekable, stridable"

<Http body>

..

<Http body> package format:

Command (2 bytes)

Length (2 bytes)

Data (length bytes)

...

...

...

Data

SEQ (4)

ID (1)

Flag (1)

Length (2)

ASF data (length-8)

Save: Write All ASF data to the local file. After receiving the data, write back several important fields (file size/creation date/data packets count/play duration/send duration/preroll/flags) of asf_file_properties_object. ASF File

00000000 48 54 50 2f 31 2E 30 20 32 30 30 20 4f 4B 0d HTTP/1.0 200 OK.

...

201700e0 6B 61 62 6C 65 2C 73 74 72 69 64 61 62 6C 65 22 Kable, St ridable"

1000000f0 0d 0a 0d 0a

201700f4 24 48 44 0b00 00 00 00 04 44 0b 30 26 B2 75 $ HD ...... d.0 &. u

00000104 8e 66 CF 11 A6 D9 00 AA 00 62 ce 6C 8f 0d 00 00. f ...... B. L ....

00000114 00 00 00 00 09 00 00 00 01 02 A1 dc AB 8C 47 A9.

00000124 CF 11 8e E4 00 C0 0C 20 53 65 68 00 00 00 00 00 ...... seh .....

...

<Type Header structure>: 24 48 44 0b

Command: 24 48

2448 "$ H" header packet follows

2444 "$ D" data (media) packet follows

A444 "? D "data (sometimes used instead of $ D)

2445 "$ E" end of stream

2443 "$ C" changing media-Reload new media, new ASF header follows

244d "$ m" meta data follows (used for custom scripts)

2450 "$ P" Packet Pair data follows

Length: 44 0b = 0b44, next header ADDR = 000000f4 + 0b44 + 4 = 00000c3c

<Type Object>: 00 00 00 00 04 44 0b

SEQ: 00 00 00 00

ID: 00 (00 = live 01 = pre-recorded)

Flag: 04 (00 = middle of packet, 04 = first packet

08 = last packet 0C = only one packe)

<ASF header>: 30 26 B2 ..

ASF header size = 8f 0d 00 00 00 00 00 = 0d8f = 2271

Asf_file_properties_object = 8cabdca1-a947-11cf-8ee4-00c00c205365

= A1 dc AB 8C 47 A9 CF 11 8e E4 00 C0 0C 20 53 65

<ASF header...>

Next ADDR = 00000c3c + 028d + 4 = 00000mcm

00000c3c 24 48 8d 02 01 00 00 00 08 8d 02 00 69 00 61 $ H ...... I.

00000c4c 00 20 00 56 00 69 00 64 00 65 00 6f 00 20 00 39 .. v. I. D. E. O. 9

...

00000e8c 84 00 00 02 00 2D A2 00 00 03 00 2D 8A 03 00 36 ......-...... 6

00000e9c 26 B2 75 8e 66 CF 11 A6 D9 00 AA 00 62 ce 6C 0a &. U. f ...... B. L.

00000eac F8 8f 00 00 00 00 8C 59 E9 68 6e 33 1D 47 8f ...... Y. hn3.g.

00000ebc 2f 57 6e 11 E0 37 C5 C3 0C 00 00 00 00 00 01/WN ...... 7 ..........

00000ecc 01

Above 36 26... start with <Data Object>

<ASF data packet> next ADDR = 00000mcm + 0b4f + 4 = 1271a20

Live, seq = 05e7, first frame, packet size = 0b4f-8 = 0b47= 2887

00000mcm 24 44 4f 0b E7 05 00 00 00 04 4f 0b 82 00 00 09 $ do ...... o .....

00000edd 5d 00 0d C8 01 00 0a 00 82 03 43 be 02 00 00 0a .....

00000eed EA 03 00 00 80 D3 01 00 28 00 2C 01 07 D0 91 D0 ........(.,.....

<ASF data packet> next ADDR = 20171a20 + 0b4f + 4 = 00002573

Live, seq = 05e8

Listen 1a19 04 62 86 dd 4C 94 48 24 44 4f 0b E8. B. l. h $ do ..

Listen 1a25 05 00 00 00 00 4f 0b 82 00 00 09 5d 00 18 C8 01 ...... o ......] ......

20171a35 00 5E 00 84 82 A9 EA 09 00 00 08 8e 0a 00 00 D0 ..............

Listen 1a45 D3 01 00 A4 00 B4 C5 18 44 00 04 1f 2C 86 08 ac ...,...

..

<ASF data packet> next ADDR = 00002573 + 0b4f + 4 = 41530c6

Live, seq = 05e9

00002561 16 FC 1C FC 85 00 63 4C E2 09 02 48 A2 08 07 B5 ...... Cl ...... H ....

00002571 66 D4 24 44 4f 0b E9 05 00 00 00 00 F. $ do .......

Listen 257d 4f 0b 82 00 00 09 5d 00 76 C8 01 00 6C 00 84 03 o ......]. V...

2017258d 46 83 02 00 00 0a 25 04 00 00 F8 D3 01 00 28 00 F ....% .......(.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.