RFC 3189

RTP Payload Format for DV (IEC 61834) Video

πŸ“… published January 2002, from ietf

RTP Payload Format for DV (IEC 61834) Video πŸŽ€

okay bestie, so this spec is by Kobayashi, Ogawa, Casner and Bormann, all from Communication Research Laboratory, Keio University, Packet Design and Universitaet Bremen TZI 🌸. It came out in January 2002 as Standards Track (so it's an actual protocol spec) and it's from the Network Working Group πŸ’œ. The title block doesn't list anything it obsoletes or updates, so it's standing on its own ✨.

Status of this Memo πŸ¦‹

This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for improvements. Please refer to the current edition of the "Internet Official Protocol Standards" (STD 1) for the standardization state and status of this protocol. Distribution of this memo is unlimited.

Copyright (C) The Internet Society (2002). All Rights Reserved.

Abstract πŸ’–

This doc is all about packing up the compressed digital video streams people call "DV" into a payload format for the Real-Time Transport Protocol (RTP) πŸ“¦. Basically, it's the recipe for getting DV into RTP packets 🧚.

1. Introduction ✨

okay so this doc lays out payload formats for shoving both consumer and professional DV streams into RTP, version 2 [6] 🎬. DV audio and video formats were built for helical-scan magnetic tape πŸ“Ό. The consumer DV standards, IEC 61883 and 61834, cover basically everything: the cassette's mechanics, the magnetic recording format, error correction on the tape, the DCT video encoding and the audio encoding [1] πŸ’…. The digital interface part of IEC 61883 defines an interface on an IEEE 1394 network [2,3] πŸ”Œ.

This spec family supports a bunch of video formats: SD-VCR (Standard Definition), HD-VCR (High Definition), SDL-VCR (Standard Definition - Long), PALPlus, DVB (Digital Video Broadcast) and ATV (Advanced Television) πŸ“Ί. North American formats are marked with a number of lines and "/60", and European formats use "/50" 🌍. The professional DV standards were published by SMPTE as 306M and 314M, covering different sampling systems, higher color resolution and faster bit rates [4,5] πŸ”₯.

There are two kinds of DV: consumer and professional πŸ‘‘. The original "DV" spec, made for consumer digital VCRs, was approved as the IEC 61834 standard set πŸŽ€. The professional specs are SMPTE 306M and 314M πŸ’œ. Both encoding formats are based on consumer DV and are used in SMPTE D-7 and D-9 video systems πŸ¦‹. The RTP payload format in this doc supports IEC 61834 consumer DV and professional SMPTE 306M and 314M (DV-Based) formats 🌸.

IEC 61834 also covers magnetic tape recording for digital TV broadcasting systems (like DVB and ATV) that use MPEG2 encoding πŸ“‘. The payload format for putting MPEG2 into RTP was already defined in RFC 2250 [7] and others πŸ™Œ.

So the payload in this doc is going to support six IEC video formats: SD-VCR (525/60, 625/50), HD-VCR (1125/60, 1250/50) and SDL-VCR (525/60, 625/50) 🎞️. It also covers six SMPTE ones: 306M (525/60, 625/50), 314M 25Mbps (525/60, 625/50) and 314M 50Mbps (525/60, 625/50) πŸ“. Later on it can be extended to other high-definition formats πŸš€.

Throughout this spec we use the terminology of the IEC and SMPTE standards a lot πŸ“š. Readers should check the original references for what those terms mean πŸ€“.

1.1 Terminology

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [8] πŸ’….

2. DV format encoding πŸ§šβ€β™€οΈ

okay so the DV format only uses DCT compression within each frame 🌈. That's different from the interframe compression used by the MPEG video standards [9,10] πŸ™ˆ. All video data, including audio and other system data, is managed in units of the picture frame πŸŽ€.

The DV video encoding has a three-level hierarchical structure πŸ”₯. A picture frame is split into rectangle-shaped or clipped-rectangle-shaped DCT super blocks ✨. Then those DCT super blocks are split into 27 rectangle- or square-shaped DCT macro blocks πŸ’–.

Audio is encoded with PCM format 🎢. The sampling frequency is 32 kHz, 44.1 kHz or 48 kHz, and the quantization is 12-bit non-linear, 16-bit linear or 20-bit linear πŸ¦‹. The number of channels may be up to 8 🌸. Only certain combinations of these parameters are allowed, depending on the video format, and the restrictions are specified in each document πŸ’œ.

A frame of data in the DV format stream is split into several "DIF sequences" πŸ“. A DIF sequence is made of an integral number of 80-byte DIF blocks πŸ“¦. The DIF block is the primitive unit for all treatment of DV streams, so it's the main character here πŸ‘‘. Each DIF block has a 3-byte ID header that says what type of DIF block it is and where it sits in the DIF sequence 🧩. There are five types of DIF blocks: DIF sequence header, Subcode, Video Auxiliary information (VAUX), Audio and Video 🎬. Audio DIF blocks are made of 5 bytes of Audio Auxiliary data (AAUX) plus 72 bytes of audio data 🎧.

Each RTP packet starts with the RTP header defined in RFC 1889 [6] πŸ’Œ. No extra payload-format-specific header is required for this payload format πŸ™Œ.

2.1 RTP header usage

Here's how the RTP header fields that mean something specific to DV get used πŸ’…:

Payload type (PT): The payload type is dynamically assigned by means outside the scope of this document πŸŽ€. If multiple DV encoding formats are going to be used within one RTP session, then multiple dynamic payload types MUST be assigned, one for each DV encoding format 🌈. The sender MUST change to the corresponding payload type whenever the encoding format is changed πŸ”.

Timestamp: This is a 32-bit 90 kHz timestamp showing the time at which the first data in the frame was sampled ⏰. All RTP packets within the same video frame MUST have the same timestamp πŸ’–. The timestamp SHOULD increment by a multiple of the nominal interval for one frame time, as given in the following table πŸ¦‹:

    Mode        Frame rate (Hz)      Increase of one frame
                                     in 90kHz timestamp

   525-60         29.97                   3003
   625-50         25                      3600
   1125-60        30                      3000
   1250-50        25                      3600

When the DV stream comes from an IEEE 1394 interface, the progress of video frame times MAY be monitored using the SYT timestamp carried in the CIP header, as specified in IEC 61883 [2] πŸ”Œβœ¨.

Marker bit (M): The marker bit of the RTP fixed header is set to one on the last packet of a video frame, and otherwise must be zero 🏁. The M bit lets the receiver know it has the last packet of a frame, so it can display the image without waiting for the first packet of the next frame to show up and reveal the frame change πŸ–ΌοΈ. Still, detection of a frame change MUST NOT rely on the marker bit, because the last packet of the frame might get lost 😭. Detection of a frame change MUST be based on a difference in the RTP timestamp πŸ’œ.

2.2 DV data encapsulation into RTP payload

Integral DIF blocks go into the RTP payload, starting right after the RTP header πŸ“¦. Any number of DIF blocks may be packed into one RTP packet, except that all DIF blocks in one RTP packet must be from the same video frame πŸŽ€. DIF blocks from the next video frame MUST NOT be packed into the same RTP packet, even if there's more payload space left πŸ™…β€β™€οΈ. This requirement exists because a change in the RTP timestamp is how the switch from one video frame to the next gets signaled 🚦. It also cuts down on processing complexity for the receiver 🧠. Since the RTP payload holds an integral number of DIF blocks, the length of the RTP payload will be a multiple of 80 bytes πŸ’….

Audio and video can be sent as one bundled RTP stream, or in separate RTP streams (unbundled) 🎢🎬. The choice MUST be indicated as part of the assignment of the dynamic payload type, and it MUST remain unchanged for the whole RTP session, so you don't have to deal with messy sequence number synchronization 🧹. The RTP sender MAY leave out DIF-sequence header and subcode DIF blocks from a stream, since that info is either known out-of-band or might not be needed for RTP transport 🫢. When DIF-sequence header and subcode DIF blocks are sent, both types of blocks MUST be included in the video stream πŸ’–.

DV streams include "source" and "source control" packs that carry info that's basically essential for decoding, like aspect ratio, picture position, quantization of audio sampling, number of audio channels, audio channel assignment and audio language 🌸. Describing all of these attributes with a signaling protocol would mean huge descriptions listing every combination, which is a lot 😡. So no Session Description Protocol (SDP) [13] parameters for these attributes are defined in this document πŸ™ˆ. Instead, the RTP sender MUST transmit at least those VAUX DIF blocks and/or audio DIF blocks with AAUX information bytes that include "source" and "source control" packs containing the essential info needed for decoding ✨.

With one bundled stream, DIF blocks for both audio and video get packed into RTP packets in the same order they were encoded πŸŽ€.

With an unbundled stream, only the header, subcode, video and VAUX DIF blocks are sent within the video stream 🎬. Audio goes in a different stream if you want, using a different RTP payload type 🎧. You can also send audio duplicated in a separate stream, in addition to bundling it with the video stream πŸ¦‹.

When using unbundled mode, it is RECOMMENDED that the audio stream data be pulled out of the DIF blocks and repackaged into the matching RTP payload format for the audio encoding (DAT12, L16, L20) [11,12]. This keeps things interoperable with non-DV-capable receivers while keeping the original source quality πŸŒˆπŸ’œ.

For unbundled transmission where both audio and video are sent in DV format, the same timestamp SHOULD be used for audio and video data within the same frame, so lip sync is easier for the receiver πŸ‘„βœ¨. Lip synchronization can also be done using reference timestamps passed in RTCP, as described in RFC 1889 [6] πŸ™Œ.

The sender MAY lower the video frame rate by discarding the video data and VAUX DIF blocks for some of the video frames πŸ¦‹. The RTP timestamp must still be incremented to account for the discarded frames ⏰. The sender MAY alternatively cut bandwidth by discarding video data DIF blocks for portions of the image that haven't changed from the previous image πŸ“‰. To make this bandwidth reduction work, receivers SHOULD implement an error concealment strategy to handle lost or missing DIF blocks, for example by repeating the matching DIF block from the previous image πŸ›ŸπŸ’…

3. SDP Signaling for RTP/DV ✨

okay so when you use SDP (Session Description Protocol) [13] to negotiate the RTP payload info, you SHOULD use the format described in this doc πŸ’…. SDP looks a little different for bundled streams vs unbundled ones, so let's check both πŸŽ€

If a DV stream is sent to port 31394 with RTP payload type identifier 111, the m=?? line looks like this πŸ¦‹

m=video 31394 RTP/AVP 111

The a=rtpmap attribute looks like this 🌸

a=rtpmap:111 DV/90000

"DV" is the encoding name for the DV video payload format defined in this doc. The "90000" is the RTP timestamp clock rate, which for this payload format is a 90kHz clock ⏰

In SDP, format-specific parameters go in a=fmtp, like this ✨

a=fmtp:<format> <format-specific parameters>

For the DV video payload format, the a=fmtp line shows the encoding type used within the DV video, and it looks like this πŸ’œ

a=fmtp:<payload type> encode=<DV-video encoding>

The required parameter <DV-video encoding> tells you which type of DV format is being used. The DV format name will be one of these πŸ‘‘

SD-VCR/525-60
SD-VCR/625-50
HD-VCR/1125-60
HD-VCR/1250-50
SDL-VCR/525-60
SDL-VCR/625-50
306M/525-60
306M/625-50
314M-25/525-60
314M-25/625-50
314M-50/525-60
314M-50/625-50

To show whether the audio data is bundled into the DV stream or not, there's a format-specific parameter for that too 🎧

a=fmtp:<payload type> audio=<audio bundled>

The optional parameter <audio bundled> will be one of these πŸ“

bundled
none     (default)

If the fmtp audio parameter isn't there, then audio data MUST NOT be bundled into the DV video stream. Bestie, that one's a hard no πŸ™…β€β™€οΈ

3.1 SDP description for unbundled streams

With unbundled mode, the RTP streams for video and audio get sent separately, to different ports or different multicast groups 🌈 When that happens, the SDP carries several m=?? lines, one for each media type in the session (see RFC 2327 [13]).

Here's an example SDP description using these attributes 🧚

v=0
o=ikob 2890844526 2890842807 IN IP4 126.16.64.4
s=POI Seminar
i=A Seminar on how to make Presentations on the Internet
u=http://www.koganei.wide.ad.jp/~ikob/POI/index.html
e=ikob@koganei.wide.ad.jp (Katsushi Kobayashi)
c=IN IP4 224.2.17.12/127
t=2873397496 2873404696
m=audio 49170 RTP/AVP 112
a=rtpmap:112 L16/32000/2
m=video 50000 RTP/AVP 113
a=rtpmap:113 DV/90000
a=fmtp:113 encode=SD-VCR/525-60
a=fmtp:113 audio=none

So this session sends audio and video separately 🎢 It goes to the multicast group 224.2.17.12. The audio uses L16 format, and the video uses SD-VCR 525/60 format, which matches NTSC in consumer DV πŸ“Ί

3.2 SDP description for bundled streams

When you send a bundled stream, all the DIF blocks, system data included, go through one single RTP stream 🫢 Here's an example SDP description for a bundled DV stream πŸ’–

v=0
o=ikob 2890844526 2890842807 IN IP4 126.16.64.4
s=POI Seminar
i=A Seminar on how to make Presentations on the Internet
u=http://www.koganei.wide.ad.jp/~ikob/POI/index.html
e=ikob@koganei.wide.ad.jp (Katsushi Kobayashi)
c=IN IP4 224.2.17.12/127
t=2873397496 2873404696
m=video 49170 RTP/AVP 112 113
a=rtpmap:112 DV/90000
a=fmtp: 112 encode=SD-VCR/525-60
a=fmtp: 112 audio=bundled
a=fmtp: 113 encode=306M/525-60
a=fmtp: 113 audio=bundled

This SDP record describes a session where audio and video are sent bundled together πŸŽ€ It goes to the multicast group 224.2.17.12. The video is sent in both 525/60 consumer DV and SMPTE standard 306M formats, using payload types 112 and 113 respectively πŸ¦‹

4. Security Considerations πŸ”

Okay, this section is serious, so let's be serious 😭 RTP packets using the payload format defined in this spec are subject to the security considerations in the RTP spec [6], plus any appropriate RTP profile. That means confidentiality of the media streams comes from encryption πŸ”’ Because the data compression used with this payload format is applied end-to-end, you can encrypt after compressing, so the two operations don't clash πŸ™Œ

There's a potential denial-of-service threat for data encodings that use compression with non-uniform receiver-end computational load 😬 An attacker could inject pathological datagrams into the stream that are complex to decode and overload the receiver. Lowkey scary! However, this encoding does not exhibit any significant non-uniformity, so that's a relief 🌸

As with any IP-based protocol, a receiver may sometimes get overloaded just from receiving too many packets, wanted or unwanted πŸ“¦ Network-layer authentication can be used to discard packets from unwanted sources, but the processing cost of the authentication itself may be too high πŸ’€ In a multicast environment, pruning of specific sources may be implemented in future versions of IGMP [14] and in multicast routing protocols, so a receiver can select which sources are allowed to reach it πŸ‘‘

5. IANA Considerations πŸ“‹

This document defines a new RTP payload name and associated MIME type, DV πŸŽ‰ The registration forms for the MIME types, for both video and audio, are in the next sections.

5.1 DV video MIME registration form

Here's the DV video MIME registration form πŸ’…

MIME media type name: video

MIME subtype name: DV

Required parameters:
   encode: type of DV format.  Permissible values for encode are
      SD-VCR/525-60, SD-VCR/625-50, HD-VCR/1125-60 HD-VCR/1250-50,
      SDL-VCR/525-60, SDL-VCR/625-50, 306M/525-60, 306M/625-50,
      314M-25/525-60, 314M-25/625-50, 314M-50/525-60, and
      314M-50/625-50.

Optional parameters:
   audio: whether the DV stream includes audio data or not.
      Permissible values for audio are bundled and none.  Defaults to
      none.

Encoding considerations:
   DV video can be transmitted with RTP as specified in RFC 3189.
   Other transport methods are not specified.

Security considerations:
   See Section 4 of RFC 3189.

Interoperability considerations: NONE

Published specification: IEC 61834 Standard
   SMPTE 306M
   SMPTE 314M
   RFC 3189

Applications which use this media type:
   Video communication.

Additional information: None
   Magic number(s): None
   File extension(s): None
   Macintosh File Type Code(s): None

Person & email address to contact for further information:
   Katsushi Kobayashi
   e-mail: ikob@koganei.wide.ad.jp

Intended usage: COMMON

Author/Change controller:
   Katsushi Kobayashi
   e-mail: ikob@koganei.wide.ad.jp

5.2 DV audio MIME registration form

And here's the DV audio one 🎧

MIME media type name: audio

MIME subtype name: DV

Required parameters:
   encode: type of DV format.  Permissible values for encode are
      SD-VCR/525-60, SD-VCR/625-50, HD-VCR/1125-60 HD-VCR/1250-50,
      SDL-VCR/525-60, SDL-VCR/625-50, 306M/525-60, 306M/625-50,
      314M-25/525-60, 314M-25/625-50, 314M-50/525-60, and
      314M-50/625-50.

Optional parameters: NONE

Encoding considerations:
   DV audio can be transmitted with RTP as specified in RFC 3189.
   Other transport methods are not specified.

Security considerations:
   See Section 4 of RFC 3189.

Interoperability considerations: NONE

Published specification: IEC 61834 Standard
   SMPTE 306M
   SMPTE 314M
   RFC 3189

Applications which use this media type:
   Audio communication.

Additional information: None
   Magic number(s): None
   File extension(s): None
   Macintosh File Type Code(s): None

Person & email address to contact for further information:
   Katsushi Kobayashi
   e-mail: ikob@koganei.wide.ad.jp

Intended usage: COMMON

Author/Change controller:
   Katsushi Kobayashi
   e-mail: ikob@koganei.wide.ad.jp

okay bestie, last stretch πŸŽ€ the legal bit is something we keep word for word so nobody can mess with it πŸ’…

Copyright (C) The Internet Society (2002). All Rights Reserved.

This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English.

The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns.

This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 🫢

Acknowledgement

Funding for the RFC Editor function is currently provided by the Internet Society. 🌈 And that's the whole doc, bestie. We made it πŸ’–

πŸ“¦ where this page comes from