The Enhanced RTMP specification (version 2, 2024) from Veovera extends the FLV tag bodies to carry modern codecs, identified by FourCC instead of the old 4-bit IDs, as well as HDR colour metadata, multichannel audio, several tracks in one stream and nanosecond time offsets. The file header and the 11-byte tag header do not change, and the old layouts stay valid: a reader tells the new ones by a flag in the first byte of an audio or video tag’s data.
ExVideoTagHeader
A video tag is in the enhanced layout when the top bit of its first byte is set; the old VideoTagHeader could not set it, because frame types stop at 5.
| Field | Type | Meaning |
|---|---|---|
| IsExHeader | UB[1] | Bit 7: 1 for this layout. |
| VideoFrameType | UB[3] | Bits 6 to 4: the frame type, as before (below). |
| VideoPacketType | UB[4] | Bits 3 to 0: what the packet holds (below). The old CodecID is not there. |
| ModEx | see ModEx | While VideoPacketType is 7: a modifier, then the next packet type. |
| VideoCommand | UI8 | When VideoFrameType is 5 and the packet type is not Metadata: the command (below), and nothing more follows. |
| AvMultitrackType, VideoPacketType | UB[4], UB[4] | When VideoPacketType is 6 (Multitrack): see multitrack; the second field is the tracks’ packet type, which cannot be Multitrack. |
| VideoFourCc | FOURCC | The codec (below), except in a ManyTracksManyCodecs packet, where each track has its own. |
| VideoFrameType | Meaning |
|---|---|
| 0 | Reserved |
| 1 | KeyFrame: a seekable frame |
| 2 | InterFrame: a non-seekable frame |
| 3 | DisposableInterFrame: H.263 only |
| 4 | GeneratedKeyFrame: reserved for server use |
| 5 | Command: a video info or command frame |
| 6, 7 | Reserved |
| VideoPacketType | Name | Body |
|---|---|---|
| 0 | SequenceStart | The codec’s configuration record (below). |
| 1 | CodedFrames | For avc1, hvc1 and vvc1, an SI24 composition time offset in milliseconds, then the frame; for the others, the frame alone. |
| 2 | SequenceEnd | Nothing: the end of the sequence. |
| 3 | CodedFramesX | The frame, with the composition time offset taken as 0 (it is left out); for avc1, hvc1 and vvc1. |
| 4 | Metadata | AMF values: a name and its value, as in script data. The only one defined is colorInfo (below). The frame type flags are not used. |
| 5 | MPEG2TSSequenceStart | For av01: the AV1 video descriptor from the AV1-in-MPEG-2-TS specification, a configuration as a transport stream gives it. |
| 6 | Multitrack | See multitrack. |
| 7 | ModEx | See ModEx. |
| 8 to 15 | Reserved |
| VideoFourCc | Codec | SequenceStart | CodedFrames |
|---|---|---|---|
avc1 | AVC (H.264) | AVCDecoderConfigurationRecord (ISO/IEC 14496-15) | NAL units, each after its length; full frames |
hvc1 | HEVC (H.265) | HEVCDecoderConfigurationRecord (ISO/IEC 14496-15) | NAL units, each after its length |
vvc1 | VVC (H.266) | VVCDecoderConfigurationRecord (ISO/IEC 14496-15) | NAL units, each after its length |
av01 | AV1 | AV1CodecConfigurationRecord (AV1 in ISOBMFF) | The OBUs of one temporal unit, in the low overhead format |
vp09 | VP9 | VPCodecConfigurationRecord (VP codec ISOBMFF binding) | One whole frame |
vp08 | VP8 | VPCodecConfigurationRecord | One whole frame |
The length before each NAL unit is as long as the configuration record’s lengthSizeMinusOne + 1 says. FFmpeg writes the VP9 record with the vpcC box’s 4-byte version and flags in front of it.
| VideoCommand | Name |
|---|---|
| 0 | StartSeek: the start of a client-side seeking frame sequence |
| 1 | EndSeek: its end |
| 2 to 255 | Reserved |
ExAudioTagHeader
An audio tag is in the enhanced layout when its SoundFormat is 9, which Adobe’s specification left reserved. The rate, size and type bits are then not read: the low four bits are the AudioPacketType.
| Field | Type | Meaning |
|---|---|---|
| SoundFormat | UB[4] | Bits 7 to 4: 9 (ExHeader). |
| AudioPacketType | UB[4] | Bits 3 to 0: what the packet holds (below). |
| ModEx | see ModEx | While AudioPacketType is 7: a modifier, then the next packet type. |
| AvMultitrackType, AudioPacketType | UB[4], UB[4] | When AudioPacketType is 5 (Multitrack): see multitrack; the second field is the tracks’ packet type, which cannot be Multitrack. |
| AudioFourCc | FOURCC | The codec (below), except in a ManyTracksManyCodecs packet, where each track has its own. |
| AudioPacketType | Name | Body |
|---|---|---|
| 0 | SequenceStart | The codec’s configuration (below). |
| 1 | CodedFrames | Coded audio (below). |
| 2 | SequenceEnd | Nothing: the end of the track’s sequence. |
| 3 | Reserved | |
| 4 | MultichannelConfig | The channel layout (below). |
| 5 | Multitrack | See multitrack. |
| 6 | Reserved | |
| 7 | ModEx | See ModEx. |
| 8 to 15 | Reserved | The specification leaves them unnamed. |
| AudioFourCc | Codec | SequenceStart | CodedFrames |
|---|---|---|---|
mp4a | AAC | The AudioSpecificConfig (ISO/IEC 14496-3) | Raw AAC frames |
.mp3 | MP3 | None defined | MP3 frames, each with its own header |
Opus | Opus | The Opus ID header of RFC 7845, section 5.1 (OpusHead); when empty, the channels come from a MultichannelConfig, or else mono or stereo | N Opus packets: the first N − 1 in the self-delimiting framing of RFC 6716 appendix B, the last as usual; all of one duration |
fLaC | FLAC | The fLaC signature and the metadata blocks, STREAMINFO first | FLAC frames, each with its frame header |
ac-3 | AC-3 | None defined | AC-3 syncframes (ATSC A/52) |
ec-3 | E-AC-3 | None defined | E-AC-3 syncframes |
FFmpeg writes a FLAC SequenceStart as the 34 bytes of STREAMINFO alone, without the signature or the block header. The old way of signalling still works for AAC and MP3: a file may use SoundFormat 10 or 2 instead of a FourCC. An audio message of no bytes at all, with no header, means silence.
MultichannelConfig
| Field | Type | Meaning |
|---|---|---|
| AudioChannelOrder | UI8 | 0 Unspecified: only the count is known. 1 Native: a channel mask follows. 2 Custom: a channel map follows. 3 to 15 reserved. |
| channelCount | UI8 | The number of channels. |
| Channel map | UI8[channelCount] | Custom order only: for each channel in turn, the AudioChannel it is (below). |
| Channel mask | UI32 | Native order only: an AudioChannelMask, one bit for each channel present; the channels come in the order of the bits. |
ModEx
A packet type of 7, ModEx, means a modifier comes before the real packet. Several can follow one another; each ends with the next packet type.
| Field | Type | Meaning |
|---|---|---|
| modExDataSize | UI8 | The size of the data, less 1. 255 (a size of 256) means the size is in the next field instead. |
| modExDataSize | UI16 | Only when the byte above is 255: the size, less 1. |
| modExData | UI8[size] | The modifier’s data. |
| PacketModExType | UB[4] | What the modifier is (below). |
| PacketType | UB[4] | The next packet type: another ModEx, or the real one. |
| PacketModExType | Name | Meaning |
|---|---|---|
| 0 | TimestampOffsetNano | The data starts with a UI24: nanoseconds to add to this message’s time, for precision beyond the millisecond. It applies to the current message only and does not change the tag’s timestamp. |
| 1 to 15 | Reserved |
Multitrack and channels
A Multitrack packet carries data for tracks other than the default, or for several tracks at once. After the AvMultitrackType and the tracks’ packet type (and the FourCC, unless each track has its own), the body is a run of tracks:
| Field | Type | Meaning |
|---|---|---|
| FourCC | FOURCC | ManyTracksManyCodecs only: this track’s codec. |
| trackId | UI8 | The track. 0 is the default track, described by the top-level onMetaData properties; others are usually numbered from 1, with no ranking implied. |
| sizeOfAudioTrack or sizeOfVideoTrack | UI24 | Not in OneTrack packets: the bytes of this track’s body that follow, to find the next track. |
| body | The body for the packet type, as for a single track. |
| AvMultitrackType | Name | Meaning |
|---|---|---|
| 0 | OneTrack | One track, given by trackId; its body runs to the end of the tag. |
| 1 | ManyTracks | Several tracks of the same codec. |
| 2 | ManyTracksManyCodecs | Several tracks, each with its own FourCC. |
| 3 to 15 | Reserved |
| AudioChannelOrder | Name |
|---|---|
| 0 | Unspecified |
| 1 | Native |
| 2 | Custom |
| 3 to 15 | Reserved |
AudioChannelMask bits name the channels below; the channel index is the
bit number.
| Index | Mask | AudioChannel |
|---|---|---|
| 0 | 0x000001 | FrontLeft |
| 1 | 0x000002 | FrontRight |
| 2 | 0x000004 | FrontCenter |
| 3 | 0x000008 | LowFrequency1 |
| 4 | 0x000010 | BackLeft |
| 5 | 0x000020 | BackRight |
| 6 | 0x000040 | FrontLeftCenter |
| 7 | 0x000080 | FrontRightCenter |
| 8 | 0x000100 | BackCenter |
| 9 | 0x000200 | SideLeft |
| 10 | 0x000400 | SideRight |
| 11 | 0x000800 | TopCenter |
| 12 | 0x001000 | TopFrontLeft |
| 13 | 0x002000 | TopFrontCenter |
| 14 | 0x004000 | TopFrontRight |
| 15 | 0x008000 | TopBackLeft |
| 16 | 0x010000 | TopBackCenter |
| 17 | 0x020000 | TopBackRight |
| 18 | 0x040000 | LowFrequency2 |
| 19 | 0x080000 | TopSideLeft |
| 20 | 0x100000 | TopSideRight |
| 21 | 0x200000 | BottomFrontCenter |
| 22 | 0x400000 | BottomFrontLeft |
| 23 | 0x800000 | BottomFrontRight |
In a custom channel map, 24 to 253 are reserved, 0xFE (Unused) is an
empty channel a player may skip, and 0xFF (Unknown) is a channel with
sound whose speaker is not known.
Metadata
A video Metadata packet carries colorInfo, an object describing the colour
of the frames that follow, for HDR. Sending Undefined or an empty object resets it.
| Property | Type | Meaning |
|---|---|---|
colorConfig.bitDepth | Number | Bits per colour channel per pixel: 8, 10 or 12. |
colorConfig.colorPrimaries | Number | An ITU-T H.273 colour primaries code, 0 to 255. |
colorConfig.transferCharacteristics | Number | An H.273 transfer characteristics code (PQ, HLG and so on). |
colorConfig.matrixCoefficients | Number | An H.273 matrix coefficients code. |
hdrCll.maxFall | Number | The maximum frame-average light level of the sequence, 0.0001 to 10,000 cd/m². |
hdrCll.maxCLL | Number | The maximum light level of any pixel in the sequence, 0.0001 to 10,000 cd/m². |
hdrMdcv.redX, redY, greenX, greenY, blueX, blueY | Number | The mastering display’s primaries, CIE 1931 x and y (as SMPTE ST 2086). |
hdrMdcv.whitePointX, whitePointY | Number | Its white point. |
hdrMdcv.maxLuminance, minLuminance | Number | Its peak (5 to 10,000) and minimum (0.0001 to 5) luminance, in nits. |
In onMetaData,
audiocodecid and videocodecid may hold a FourCC read as a
big-endian UI32 and stored as a Number: Opus is 1332770163 and
av01 is 1635135537. Two objects describe multitrack files:
| Property | Type | Meaning |
|---|---|---|
audioTrackIdInfoMap | Object | The audio tracks after track 0, keyed by track id. Each value is an object of the usual audio properties (audiocodecid, audiodatarate, audiosamplerate, channels and so on); it may give only those that differ from track 0’s, or all of them. |
videoTrackIdInfoMap | Object | The video tracks after track 0, in the same way (videocodecid, width, height, videodatarate and so on). |
Enhanced RTMP also defines what a client and server tell each other when they connect
(fourCcList, videoFourCcInfoMap,
audioFourCcInfoMap, capsEx); those are RTMP messages, not
part of a file.