RTP Payload Format for JPEG 2000 Video Streams
Extracted elements (22)
The mh_id (Main Header Identification) field exists to support JPEG 2000 main header recovery as described in RFC 5372; implementations following only this specification SHOULD set it to 0 and receivers SHOULD ignore it, preserving forward compatibility.
The payload format is designed to maximize JPEG 2000 scalability features, including markers for headers and fragments, tile numbering for packet association, interlace odd/even field markers, and priority indicators — because JPEG 2000's intra-frame structure and scalability layers are key differentiators over JPEG.
The payload header includes a fragment offset field to support scalable video delivery using multiple RTP sessions, where the offset from the first byte of the same frame allows layered video delivery even when a packet is the first received in a session but does not start at offset 0.
If the receiver cannot handle the offered color space, it should reply with its preferred color space in the answer and gracefully end the session. Senders do not need to conform to the color space in the answer but should note the session ended due to color sampling issues.
Senders wishing to use a non-90kHz rate SHOULD also offer the same stream using a 90kHz timestamp rate with a different RTP payload type, allowing graceful fallback to 90kHz for compatibility with receivers that do not support non-standard rates.
A sender MUST preserve the codestream order when packing packetization units into RTP packets. A fragmented packetization unit MUST NOT be packed with the succeeding packetization unit within the same RTP packet.
Senders and receivers MUST support the 90kHz RTP timestamp rate, and MAY support other rates. RTP timestamp rates below 1000 Hz SHOULD NOT be used because they will result in insufficient resolution for RTCP measurements.
The clock rate MUST be negotiated at the start of the session. When using SDP, it MUST be expressed using the 'rtpmap' attribute.
The fragment offset field (24 bits) MUST be set to the byte offset of the current payload relative to the very beginning of the JPEG 2000 codestream (frame).
The RTP marker bit MUST be set to 1 for the last RTP packet of a video frame; otherwise it MUST be 0. When transmission is performed by multiple RTP sessions, this bit is 1 in the last packet of the frame in each session.
The same timestamp value MUST appear in each RTP packet carrying a fragment of a given frame. For interlaced JPEG 2000, the odd field and the corresponding even field MUST have the same timestamp value.
The 'sampling' parameter is REQUIRED and MUST be included in the 'a=fmtp' line of SDP. The media name in SDP MUST be 'video' and the encoding name MUST be 'jpeg2000'.
Users of this payload format MUST monitor packet loss to ensure the packet loss rate is within acceptable parameters when using best-effort service. Packet loss is acceptable if a TCP flow across the same network path would not achieve less average throughput than the RTP flow.
When 'width' appears in the offer or answer, 'height' MUST be present, and vice versa. Both parameters MUST appear together or not at all.
A 'packetization unit' is defined as either a JPEG 2000 main header, a tile-part header, or a JPEG 2000 packet. Senders may put an arbitrary number of packetization units into an RTP packet, but codestream order must be preserved.
The MHF (Main Header Flag) field (2 bits) indicates main header presence: 0 = no main header, 1 = fragment piece, 2 = last fragment, 3 = whole main header.
The priority field (8 bits) indicates importance of the JPEG 2000 packet in the payload; higher priority is typically set for packets containing lower sub-bands. For basic implementations, senders SHOULD set this to 255 and receivers SHOULD ignore it.
The T (Tile field invalidation flag) bit indicates whether the tile number field is valid (T=0) or invalid (T=1). A sender MUST set T=1 when the packet holds only the main header or when multiple tile-parts are packed together.
The tp (type) field (2 bits) indicates scan type: 0 = progressive, 1 = odd field of interlaced video (height in header is half the display height), 2 = even field of interlaced video.
This document registers the media subtype video/jpeg2000 with IANA. Required parameters are 'rate' (RTP timestamp clock rate, default 90000) and 'sampling' (color space). Optional parameters include 'interlace', 'width', and 'height'.
RTP packets using this payload format are subject to confidentiality, integrity, and source authenticity concerns. SRTP is recommended as a suitable security mechanism; IPsec and TLS (for RTP over TCP) are noted as alternatives.
The JPEG 2000 RTP payload header is 8 bytes: tp (2 bits, scan type), MHF (2 bits, main header flag), mh_id (3 bits, main header ID), T (1 bit, tile field invalidation flag), priority (8 bits), tile number (16 bits), reserved (8 bits), and fragment offset (24 bits).