A script data tag, type 18, holds values encoded in AMF0, Action Message Format version 0.
The usual one is a string onMetaData followed by an object or ECMA array of
the file’s properties.
AMF0 type markers
Each value starts with a one-byte marker. Numbers are big-endian. An object’s keys are 16-bit length-prefixed strings; the object ends with an empty key and marker 9.
| Marker | Type | Encoding |
|---|---|---|
| 0 | Number | IEEE 754 64-bit double. |
| 1 | Boolean | One byte, 0 or 1. |
| 2 | String | 16-bit length, then UTF-8 bytes. |
| 3 | Object | Key and value pairs, ended by an object end marker. |
| 4 | MovieClip | Reserved and not supported. Named from memory of the AMF0 specification. |
| 5 | Null | Marker only. |
| 6 | Undefined | Marker only. Named from memory of the AMF0 specification. |
| 7 | Reference | A 16-bit index to an earlier object. Named from memory of the AMF0 specification. |
| 8 | ECMA array | 32-bit entry count, then key and value pairs. |
| 9 | Object end | An empty string key (16-bit length 0), then this marker. |
| 10 | Strict array | 32-bit entry count, then values. |
| 11 | Date | 64-bit double, then a 16-bit time zone offset. |
| 12 | Long string | 32-bit length, then UTF-8 bytes. |
| 13 | Unsupported | Marker only. Named from memory of the AMF0 specification. |
| 14 | RecordSet | Reserved and not supported. Named from memory of the AMF0 specification. |
| 15 | XML document | 32-bit length, then UTF-8 bytes. |
| 16 | Typed object | 16-bit name length, UTF-8 class name, then entries. |
| 17 | Switch to AMF3 | The following value is AMF3. |
onMetaData
Wikipedia’s account lists duration, width,
height and framerate as 64-bit floats and a
keyframes array. Common properties written by muxers also include
audiocodecid, audiodatarate, audiosamplerate,
audiosamplesize, stereo, videocodecid,
videodatarate and filesize. Adobe’s full table is in its PDF
specification and has not been reproduced here. For the new track maps and FOURCC
codec IDs, see Enhanced FLV.