-
Notifications
You must be signed in to change notification settings - Fork 6
/
rfc3551.txt
executable file
·2467 lines (1712 loc) · 104 KB
/
rfc3551.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Network Working Group H. Schulzrinne
Request for Comments: 3551 Columbia University
Obsoletes: 1890 S. Casner
Category: Standards Track Packet Design
July 2003
RTP Profile for Audio and Video Conferences
with Minimal Control
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 Notice
Copyright (C) The Internet Society (2003). All Rights Reserved.
Abstract
This document describes a profile called "RTP/AVP" for the use of the
real-time transport protocol (RTP), version 2, and the associated
control protocol, RTCP, within audio and video multiparticipant
conferences with minimal control. It provides interpretations of
generic fields within the RTP specification suitable for audio and
video conferences. In particular, this document defines a set of
default mappings from payload type numbers to encodings.
This document also describes how audio and video data may be carried
within RTP. It defines a set of standard encodings and their names
when used within RTP. The descriptions provide pointers to reference
implementations and the detailed standards. This document is meant
as an aid for implementors of audio, video and other real-time
multimedia applications.
This memorandum obsoletes RFC 1890. It is mostly backwards-
compatible except for functions removed because two interoperable
implementations were not found. The additions to RFC 1890 codify
existing practice in the use of payload formats under this profile
and include new payload formats defined since RFC 1890 was published.
Schulzrinne & Casner Standards Track [Page 1]
RFC 3551 RTP A/V Profile July 2003
Table of Contents
1. Introduction ................................................. 3
1.1 Terminology ............................................. 3
2. RTP and RTCP Packet Forms and Protocol Behavior .............. 4
3. Registering Additional Encodings ............................. 6
4. Audio ........................................................ 8
4.1 Encoding-Independent Rules .............................. 8
4.2 Operating Recommendations ............................... 9
4.3 Guidelines for Sample-Based Audio Encodings ............. 10
4.4 Guidelines for Frame-Based Audio Encodings .............. 11
4.5 Audio Encodings ......................................... 12
4.5.1 DVI4 ............................................ 13
4.5.2 G722 ............................................ 14
4.5.3 G723 ............................................ 14
4.5.4 G726-40, G726-32, G726-24, and G726-16 .......... 18
4.5.5 G728 ............................................ 19
4.5.6 G729 ............................................ 20
4.5.7 G729D and G729E ................................. 22
4.5.8 GSM ............................................. 24
4.5.9 GSM-EFR ......................................... 27
4.5.10 L8 .............................................. 27
4.5.11 L16 ............................................. 27
4.5.12 LPC ............................................. 27
4.5.13 MPA ............................................. 28
4.5.14 PCMA and PCMU ................................... 28
4.5.15 QCELP ........................................... 28
4.5.16 RED ............................................. 29
4.5.17 VDVI ............................................ 29
5. Video ........................................................ 30
5.1 CelB .................................................... 30
5.2 JPEG .................................................... 30
5.3 H261 .................................................... 30
5.4 H263 .................................................... 31
5.5 H263-1998 ............................................... 31
5.6 MPV ..................................................... 31
5.7 MP2T .................................................... 31
5.8 nv ...................................................... 32
6. Payload Type Definitions ..................................... 32
7. RTP over TCP and Similar Byte Stream Protocols ............... 34
8. Port Assignment .............................................. 34
9. Changes from RFC 1890 ........................................ 35
10. Security Considerations ...................................... 38
11. IANA Considerations .......................................... 39
12. References ................................................... 39
12.1 Normative References .................................... 39
12.2 Informative References .................................. 39
13. Current Locations of Related Resources ....................... 41
Schulzrinne & Casner Standards Track [Page 2]
RFC 3551 RTP A/V Profile July 2003
14. Acknowledgments .............................................. 42
15. Intellectual Property Rights Statement ....................... 43
16. Authors' Addresses ........................................... 43
17. Full Copyright Statement ..................................... 44
1. Introduction
This profile defines aspects of RTP left unspecified in the RTP
Version 2 protocol definition (RFC 3550) [1]. This profile is
intended for the use within audio and video conferences with minimal
session control. In particular, no support for the negotiation of
parameters or membership control is provided. The profile is
expected to be useful in sessions where no negotiation or membership
control are used (e.g., using the static payload types and the
membership indications provided by RTCP), but this profile may also
be useful in conjunction with a higher-level control protocol.
Use of this profile may be implicit in the use of the appropriate
applications; there may be no explicit indication by port number,
protocol identifier or the like. Applications such as session
directories may use the name for this profile specified in Section
11.
Other profiles may make different choices for the items specified
here.
This document also defines a set of encodings and payload formats for
audio and video. These payload format descriptions are included here
only as a matter of convenience since they are too small to warrant
separate documents. Use of these payload formats is NOT REQUIRED to
use this profile. Only the binding of some of the payload formats to
static payload type numbers in Tables 4 and 5 is normative.
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 [2] and
indicate requirement levels for implementations compliant with this
RTP profile.
This document defines the term media type as dividing encodings of
audio and video content into three classes: audio, video and
audio/video (interleaved).
Schulzrinne & Casner Standards Track [Page 3]
RFC 3551 RTP A/V Profile July 2003
2. RTP and RTCP Packet Forms and Protocol Behavior
The section "RTP Profiles and Payload Format Specifications" of RFC
3550 enumerates a number of items that can be specified or modified
in a profile. This section addresses these items. Generally, this
profile follows the default and/or recommended aspects of the RTP
specification.
RTP data header: The standard format of the fixed RTP data
header is used (one marker bit).
Payload types: Static payload types are defined in Section 6.
RTP data header additions: No additional fixed fields are
appended to the RTP data header.
RTP data header extensions: No RTP header extensions are
defined, but applications operating under this profile MAY use
such extensions. Thus, applications SHOULD NOT assume that the
RTP header X bit is always zero and SHOULD be prepared to ignore
the header extension. If a header extension is defined in the
future, that definition MUST specify the contents of the first 16
bits in such a way that multiple different extensions can be
identified.
RTCP packet types: No additional RTCP packet types are defined
by this profile specification.
RTCP report interval: The suggested constants are to be used for
the RTCP report interval calculation. Sessions operating under
this profile MAY specify a separate parameter for the RTCP traffic
bandwidth rather than using the default fraction of the session
bandwidth. The RTCP traffic bandwidth MAY be divided into two
separate session parameters for those participants which are
active data senders and those which are not. Following the
recommendation in the RTP specification [1] that 1/4 of the RTCP
bandwidth be dedicated to data senders, the RECOMMENDED default
values for these two parameters would be 1.25% and 3.75%,
respectively. For a particular session, the RTCP bandwidth for
non-data-senders MAY be set to zero when operating on
unidirectional links or for sessions that don't require feedback
on the quality of reception. The RTCP bandwidth for data senders
SHOULD be kept non-zero so that sender reports can still be sent
for inter-media synchronization and to identify the source by
CNAME. The means by which the one or two session parameters for
RTCP bandwidth are specified is beyond the scope of this memo.
Schulzrinne & Casner Standards Track [Page 4]
RFC 3551 RTP A/V Profile July 2003
SR/RR extension: No extension section is defined for the RTCP SR
or RR packet.
SDES use: Applications MAY use any of the SDES items described
in the RTP specification. While CNAME information MUST be sent
every reporting interval, other items SHOULD only be sent every
third reporting interval, with NAME sent seven out of eight times
within that slot and the remaining SDES items cyclically taking up
the eighth slot, as defined in Section 6.2.2 of the RTP
specification. In other words, NAME is sent in RTCP packets 1, 4,
7, 10, 13, 16, 19, while, say, EMAIL is used in RTCP packet 22.
Security: The RTP default security services are also the default
under this profile.
String-to-key mapping: No mapping is specified by this profile.
Congestion: RTP and this profile may be used in the context of
enhanced network service, for example, through Integrated Services
(RFC 1633) [4] or Differentiated Services (RFC 2475) [5], or they
may be used with best effort service.
If enhanced service is being used, RTP receivers SHOULD monitor
packet loss to ensure that the service that was requested is
actually being delivered. If it is not, then they SHOULD assume
that they are receiving best-effort service and behave
accordingly.
If best-effort service is being used, RTP receivers SHOULD monitor
packet loss to ensure that the packet loss rate is within
acceptable parameters. Packet loss is considered acceptable if a
TCP flow across the same network path and experiencing the same
network conditions would achieve an average throughput, measured
on a reasonable timescale, that is not less than the RTP flow is
achieving. This condition can be satisfied by implementing
congestion control mechanisms to adapt the transmission rate (or
the number of layers subscribed for a layered multicast session),
or by arranging for a receiver to leave the session if the loss
rate is unacceptably high.
The comparison to TCP cannot be specified exactly, but is intended
as an "order-of-magnitude" comparison in timescale and throughput.
The timescale on which TCP throughput is measured is the round-
trip time of the connection. In essence, this requirement states
that it is not acceptable to deploy an application (using RTP or
any other transport protocol) on the best-effort Internet which
consumes bandwidth arbitrarily and does not compete fairly with
TCP within an order of magnitude.
Schulzrinne & Casner Standards Track [Page 5]
RFC 3551 RTP A/V Profile July 2003
Underlying protocol: The profile specifies the use of RTP over
unicast and multicast UDP as well as TCP. (This does not preclude
the use of these definitions when RTP is carried by other lower-
layer protocols.)
Transport mapping: The standard mapping of RTP and RTCP to
transport-level addresses is used.
Encapsulation: This profile leaves to applications the
specification of RTP encapsulation in protocols other than UDP.
3. Registering Additional Encodings
This profile lists a set of encodings, each of which is comprised of
a particular media data compression or representation plus a payload
format for encapsulation within RTP. Some of those payload formats
are specified here, while others are specified in separate RFCs. It
is expected that additional encodings beyond the set listed here will
be created in the future and specified in additional payload format
RFCs.
This profile also assigns to each encoding a short name which MAY be
used by higher-level control protocols, such as the Session
Description Protocol (SDP), RFC 2327 [6], to identify encodings
selected for a particular RTP session.
In some contexts it may be useful to refer to these encodings in the
form of a MIME content-type. To facilitate this, RFC 3555 [7]
provides registrations for all of the encodings names listed here as
MIME subtype names under the "audio" and "video" MIME types through
the MIME registration procedure as specified in RFC 2048 [8].
Any additional encodings specified for use under this profile (or
others) may also be assigned names registered as MIME subtypes with
the Internet Assigned Numbers Authority (IANA). This registry
provides a means to insure that the names assigned to the additional
encodings are kept unique. RFC 3555 specifies the information that
is required for the registration of RTP encodings.
In addition to assigning names to encodings, this profile also
assigns static RTP payload type numbers to some of them. However,
the payload type number space is relatively small and cannot
accommodate assignments for all existing and future encodings.
During the early stages of RTP development, it was necessary to use
statically assigned payload types because no other mechanism had been
specified to bind encodings to payload types. It was anticipated
that non-RTP means beyond the scope of this memo (such as directory
services or invitation protocols) would be specified to establish a
Schulzrinne & Casner Standards Track [Page 6]
RFC 3551 RTP A/V Profile July 2003
dynamic mapping between a payload type and an encoding. Now,
mechanisms for defining dynamic payload type bindings have been
specified in the Session Description Protocol (SDP) and in other
protocols such as ITU-T Recommendation H.323/H.245. These mechanisms
associate the registered name of the encoding/payload format, along
with any additional required parameters, such as the RTP timestamp
clock rate and number of channels, with a payload type number. This
association is effective only for the duration of the RTP session in
which the dynamic payload type binding is made. This association
applies only to the RTP session for which it is made, thus the
numbers can be re-used for different encodings in different sessions
so the number space limitation is avoided.
This profile reserves payload type numbers in the range 96-127
exclusively for dynamic assignment. Applications SHOULD first use
values in this range for dynamic payload types. Those applications
which need to define more than 32 dynamic payload types MAY bind
codes below 96, in which case it is RECOMMENDED that unassigned
payload type numbers be used first. However, the statically assigned
payload types are default bindings and MAY be dynamically bound to
new encodings if needed. Redefining payload types below 96 may cause
incorrect operation if an attempt is made to join a session without
obtaining session description information that defines the dynamic
payload types.
Dynamic payload types SHOULD NOT be used without a well-defined
mechanism to indicate the mapping. Systems that expect to
interoperate with others operating under this profile SHOULD NOT make
their own assignments of proprietary encodings to particular, fixed
payload types.
This specification establishes the policy that no additional static
payload types will be assigned beyond the ones defined in this
document. Establishing this policy avoids the problem of trying to
create a set of criteria for accepting static assignments and
encourages the implementation and deployment of the dynamic payload
type mechanisms.
The final set of static payload type assignments is provided in
Tables 4 and 5.
Schulzrinne & Casner Standards Track [Page 7]
RFC 3551 RTP A/V Profile July 2003
4. Audio
4.1 Encoding-Independent Rules
Since the ability to suppress silence is one of the primary
motivations for using packets to transmit voice, the RTP header
carries both a sequence number and a timestamp to allow a receiver to
distinguish between lost packets and periods of time when no data was
transmitted. Discontiguous transmission (silence suppression) MAY be
used with any audio payload format. Receivers MUST assume that
senders may suppress silence unless this is restricted by signaling
specified elsewhere. (Even if the transmitter does not suppress
silence, the receiver should be prepared to handle periods when no
data is present since packets may be lost.)
Some payload formats (see Sections 4.5.3 and 4.5.6) define a "silence
insertion descriptor" or "comfort noise" frame to specify parameters
for artificial noise that may be generated during a period of silence
to approximate the background noise at the source. For other payload
formats, a generic Comfort Noise (CN) payload format is specified in
RFC 3389 [9]. When the CN payload format is used with another
payload format, different values in the RTP payload type field
distinguish comfort-noise packets from those of the selected payload
format.
For applications which send either no packets or occasional comfort-
noise packets during silence, the first packet of a talkspurt, that
is, the first packet after a silence period during which packets have
not been transmitted contiguously, SHOULD be distinguished by setting
the marker bit in the RTP data header to one. The marker bit in all
other packets is zero. The beginning of a talkspurt MAY be used to
adjust the playout delay to reflect changing network delays.
Applications without silence suppression MUST set the marker bit to
zero.
The RTP clock rate used for generating the RTP timestamp is
independent of the number of channels and the encoding; it usually
equals the number of sampling periods per second. For N-channel
encodings, each sampling period (say, 1/8,000 of a second) generates
N samples. (This terminology is standard, but somewhat confusing, as
the total number of samples generated per second is then the sampling
rate times the channel count.)
If multiple audio channels are used, channels are numbered left-to-
right, starting at one. In RTP audio packets, information from
lower-numbered channels precedes that from higher-numbered channels.
Schulzrinne & Casner Standards Track [Page 8]
RFC 3551 RTP A/V Profile July 2003
For more than two channels, the convention followed by the AIFF-C
audio interchange format SHOULD be followed [3], using the following
notation, unless some other convention is specified for a particular
encoding or payload format:
l left
r right
c center
S surround
F front
R rear
channels description channel
1 2 3 4 5 6
_________________________________________________
2 stereo l r
3 l r c
4 l c r S
5 Fl Fr Fc Sl Sr
6 l lc c r rc S
Note: RFC 1890 defined two conventions for the ordering of four
audio channels. Since the ordering is indicated implicitly by
the number of channels, this was ambiguous. In this revision,
the order described as "quadrophonic" has been eliminated to
remove the ambiguity. This choice was based on the observation
that quadrophonic consumer audio format did not become popular
whereas surround-sound subsequently has.
Samples for all channels belonging to a single sampling instant MUST
be within the same packet. The interleaving of samples from
different channels depends on the encoding. General guidelines are
given in Section 4.3 and 4.4.
The sampling frequency SHOULD be drawn from the set: 8,000, 11,025,
16,000, 22,050, 24,000, 32,000, 44,100 and 48,000 Hz. (Older Apple
Macintosh computers had a native sample rate of 22,254.54 Hz, which
can be converted to 22,050 with acceptable quality by dropping 4
samples in a 20 ms frame.) However, most audio encodings are defined
for a more restricted set of sampling frequencies. Receivers SHOULD
be prepared to accept multi-channel audio, but MAY choose to only
play a single channel.
4.2 Operating Recommendations
The following recommendations are default operating parameters.
Applications SHOULD be prepared to handle other values. The ranges
given are meant to give guidance to application writers, allowing a
Schulzrinne & Casner Standards Track [Page 9]
RFC 3551 RTP A/V Profile July 2003
set of applications conforming to these guidelines to interoperate
without additional negotiation. These guidelines are not intended to
restrict operating parameters for applications that can negotiate a
set of interoperable parameters, e.g., through a conference control
protocol.
For packetized audio, the default packetization interval SHOULD have
a duration of 20 ms or one frame, whichever is longer, unless
otherwise noted in Table 1 (column "ms/packet"). The packetization
interval determines the minimum end-to-end delay; longer packets
introduce less header overhead but higher delay and make packet loss
more noticeable. For non-interactive applications such as lectures
or for links with severe bandwidth constraints, a higher
packetization delay MAY be used. A receiver SHOULD accept packets
representing between 0 and 200 ms of audio data. (For framed audio
encodings, a receiver SHOULD accept packets with a number of frames
equal to 200 ms divided by the frame duration, rounded up.) This
restriction allows reasonable buffer sizing for the receiver.
4.3 Guidelines for Sample-Based Audio Encodings
In sample-based encodings, each audio sample is represented by a
fixed number of bits. Within the compressed audio data, codes for
individual samples may span octet boundaries. An RTP audio packet
may contain any number of audio samples, subject to the constraint
that the number of bits per sample times the number of samples per
packet yields an integral octet count. Fractional encodings produce
less than one octet per sample.
The duration of an audio packet is determined by the number of
samples in the packet.
For sample-based encodings producing one or more octets per sample,
samples from different channels sampled at the same sampling instant
SHOULD be packed in consecutive octets. For example, for a two-
channel encoding, the octet sequence is (left channel, first sample),
(right channel, first sample), (left channel, second sample), (right
channel, second sample), .... For multi-octet encodings, octets
SHOULD be transmitted in network byte order (i.e., most significant
octet first).
The packing of sample-based encodings producing less than one octet
per sample is encoding-specific.
The RTP timestamp reflects the instant at which the first sample in
the packet was sampled, that is, the oldest information in the
packet.
Schulzrinne & Casner Standards Track [Page 10]
RFC 3551 RTP A/V Profile July 2003
4.4 Guidelines for Frame-Based Audio Encodings
Frame-based encodings encode a fixed-length block of audio into
another block of compressed data, typically also of fixed length.
For frame-based encodings, the sender MAY choose to combine several
such frames into a single RTP packet. The receiver can tell the
number of frames contained in an RTP packet, if all the frames have
the same length, by dividing the RTP payload length by the audio
frame size which is defined as part of the encoding. This does not
work when carrying frames of different sizes unless the frame sizes
are relatively prime. If not, the frames MUST indicate their size.
For frame-based codecs, the channel order is defined for the whole
block. That is, for two-channel audio, right and left samples SHOULD
be coded independently, with the encoded frame for the left channel
preceding that for the right channel.
All frame-oriented audio codecs SHOULD be able to encode and decode
several consecutive frames within a single packet. Since the frame
size for the frame-oriented codecs is given, there is no need to use
a separate designation for the same encoding, but with different
number of frames per packet.
RTP packets SHALL contain a whole number of frames, with frames
inserted according to age within a packet, so that the oldest frame
(to be played first) occurs immediately after the RTP packet header.
The RTP timestamp reflects the instant at which the first sample in
the first frame was sampled, that is, the oldest information in the
packet.
Schulzrinne & Casner Standards Track [Page 11]
RFC 3551 RTP A/V Profile July 2003
4.5 Audio Encodings
name of sampling default
encoding sample/frame bits/sample rate ms/frame ms/packet
__________________________________________________________________
DVI4 sample 4 var. 20
G722 sample 8 16,000 20
G723 frame N/A 8,000 30 30
G726-40 sample 5 8,000 20
G726-32 sample 4 8,000 20
G726-24 sample 3 8,000 20
G726-16 sample 2 8,000 20
G728 frame N/A 8,000 2.5 20
G729 frame N/A 8,000 10 20
G729D frame N/A 8,000 10 20
G729E frame N/A 8,000 10 20
GSM frame N/A 8,000 20 20
GSM-EFR frame N/A 8,000 20 20
L8 sample 8 var. 20
L16 sample 16 var. 20
LPC frame N/A 8,000 20 20
MPA frame N/A var. var.
PCMA sample 8 var. 20
PCMU sample 8 var. 20
QCELP frame N/A 8,000 20 20
VDVI sample var. var. 20
Table 1: Properties of Audio Encodings (N/A: not applicable; var.:
variable)
The characteristics of the audio encodings described in this document
are shown in Table 1; they are listed in order of their payload type
in Table 4. While most audio codecs are only specified for a fixed
sampling rate, some sample-based algorithms (indicated by an entry of
"var." in the sampling rate column of Table 1) may be used with
different sampling rates, resulting in different coded bit rates.
When used with a sampling rate other than that for which a static
payload type is defined, non-RTP means beyond the scope of this memo
MUST be used to define a dynamic payload type and MUST indicate the
selected RTP timestamp clock rate, which is usually the same as the
sampling rate for audio.
Schulzrinne & Casner Standards Track [Page 12]
RFC 3551 RTP A/V Profile July 2003
4.5.1 DVI4
DVI4 uses an adaptive delta pulse code modulation (ADPCM) encoding
scheme that was specified by the Interactive Multimedia Association
(IMA) as the "IMA ADPCM wave type". However, the encoding defined
here as DVI4 differs in three respects from the IMA specification:
o The RTP DVI4 header contains the predicted value rather than the
first sample value contained the IMA ADPCM block header.
o IMA ADPCM blocks contain an odd number of samples, since the first
sample of a block is contained just in the header (uncompressed),
followed by an even number of compressed samples. DVI4 has an
even number of compressed samples only, using the `predict' word
from the header to decode the first sample.
o For DVI4, the 4-bit samples are packed with the first sample in
the four most significant bits and the second sample in the four
least significant bits. In the IMA ADPCM codec, the samples are
packed in the opposite order.
Each packet contains a single DVI block. This profile only defines
the 4-bit-per-sample version, while IMA also specified a 3-bit-per-
sample encoding.
The "header" word for each channel has the following structure:
int16 predict; /* predicted value of first sample
from the previous block (L16 format) */
u_int8 index; /* current index into stepsize table */
u_int8 reserved; /* set to zero by sender, ignored by receiver */
Each octet following the header contains two 4-bit samples, thus the
number of samples per packet MUST be even because there is no means
to indicate a partially filled last octet.
Packing of samples for multiple channels is for further study.
The IMA ADPCM algorithm was described in the document IMA Recommended
Practices for Enhancing Digital Audio Compatibility in Multimedia
Systems (version 3.0). However, the Interactive Multimedia
Association ceased operations in 1997. Resources for an archived
copy of that document and a software implementation of the RTP DVI4
encoding are listed in Section 13.
Schulzrinne & Casner Standards Track [Page 13]
RFC 3551 RTP A/V Profile July 2003
4.5.2 G722
G722 is specified in ITU-T Recommendation G.722, "7 kHz audio-coding
within 64 kbit/s". The G.722 encoder produces a stream of octets,
each of which SHALL be octet-aligned in an RTP packet. The first bit
transmitted in the G.722 octet, which is the most significant bit of
the higher sub-band sample, SHALL correspond to the most significant
bit of the octet in the RTP packet.
Even though the actual sampling rate for G.722 audio is 16,000 Hz,
the RTP clock rate for the G722 payload format is 8,000 Hz because
that value was erroneously assigned in RFC 1890 and must remain
unchanged for backward compatibility. The octet rate or sample-pair
rate is 8,000 Hz.
4.5.3 G723
G723 is specified in ITU Recommendation G.723.1, "Dual-rate speech
coder for multimedia communications transmitting at 5.3 and 6.3
kbit/s". The G.723.1 5.3/6.3 kbit/s codec was defined by the ITU-T
as a mandatory codec for ITU-T H.324 GSTN videophone terminal
applications. The algorithm has a floating point specification in
Annex B to G.723.1, a silence compression algorithm in Annex A to
G.723.1 and a scalable channel coding scheme for wireless
applications in G.723.1 Annex C.
This Recommendation specifies a coded representation that can be used
for compressing the speech signal component of multi-media services
at a very low bit rate. Audio is encoded in 30 ms frames, with an
additional delay of 7.5 ms due to look-ahead. A G.723.1 frame can be
one of three sizes: 24 octets (6.3 kb/s frame), 20 octets (5.3 kb/s
frame), or 4 octets. These 4-octet frames are called SID frames
(Silence Insertion Descriptor) and are used to specify comfort noise
parameters. There is no restriction on how 4, 20, and 24 octet
frames are intermixed. The least significant two bits of the first
octet in the frame determine the frame size and codec type:
bits content octets/frame
00 high-rate speech (6.3 kb/s) 24
01 low-rate speech (5.3 kb/s) 20
10 SID frame 4
11 reserved
Schulzrinne & Casner Standards Track [Page 14]
RFC 3551 RTP A/V Profile July 2003
It is possible to switch between the two rates at any 30 ms frame
boundary. Both (5.3 kb/s and 6.3 kb/s) rates are a mandatory part of
the encoder and decoder. Receivers MUST accept both data rates and
MUST accept SID frames unless restriction of these capabilities has
been signaled. The MIME registration for G723 in RFC 3555 [7]
specifies parameters that MAY be used with MIME or SDP to restrict to
a single data rate or to restrict the use of SID frames. This coder
was optimized to represent speech with near-toll quality at the above
rates using a limited amount of complexity.
The packing of the encoded bit stream into octets and the
transmission order of the octets is specified in Rec. G.723.1 and is
the same as that produced by the G.723 C code reference
implementation. For the 6.3 kb/s data rate, this packing is
illustrated as follows, where the header (HDR) bits are always "0 0"
as shown in Fig. 1 to indicate operation at 6.3 kb/s, and the Z bit
is always set to zero. The diagrams show the bit packing in "network
byte order", also known as big-endian order. The bits of each 32-bit
word are numbered 0 to 31, with the most significant bit on the left
and numbered 0. The octets (bytes) of each word are transmitted most
significant octet first. The bits of each data field are numbered in
the order of the bit stream representation of the encoding (least
significant bit first). The vertical bars indicate the boundaries
between field fragments.
Schulzrinne & Casner Standards Track [Page 15]
RFC 3551 RTP A/V Profile July 2003
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LPC |HDR| LPC | LPC | ACL0 |LPC|
| | | | | | |
|0 0 0 0 0 0|0 0|1 1 1 1 0 0 0 0|2 2 1 1 1 1 1 1|0 0 0 0 0 0|2 2|
|5 4 3 2 1 0| |3 2 1 0 9 8 7 6|1 0 9 8 7 6 5 4|5 4 3 2 1 0|3 2|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ACL2 |ACL|A| GAIN0 |ACL|ACL| GAIN0 | GAIN1 |
| | 1 |C| | 3 | 2 | | |
|0 0 0 0 0|0 0|0|0 0 0 0|0 0|0 0|1 1 0 0 0 0 0 0|0 0 0 0 0 0 0 0|
|4 3 2 1 0|1 0|6|3 2 1 0|1 0|6 5|1 0 9 8 7 6 5 4|7 6 5 4 3 2 1 0|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| GAIN2 | GAIN1 | GAIN2 | GAIN3 | GRID | GAIN3 |
| | | | | | |
|0 0 0 0|1 1 0 0|1 1 0 0 0 0 0 0|0 0 0 0 0 0 0 0|0 0 0 0|1 1 0 0|
|3 2 1 0|1 0 9 8|1 0 9 8 7 6 5 4|7 6 5 4 3 2 1 0|3 2 1 0|1 0 9 8|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| MSBPOS |Z|POS| MSBPOS | POS0 |POS| POS0 |
| | | 0 | | | 1 | |
|0 0 0 0 0 0 0|0|0 0|1 1 1 0 0 0|0 0 0 0 0 0 0 0|0 0|1 1 1 1 1 1|
|6 5 4 3 2 1 0| |1 0|2 1 0 9 8 7|9 8 7 6 5 4 3 2|1 0|5 4 3 2 1 0|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| POS1 | POS2 | POS1 | POS2 | POS3 | POS2 |
| | | | | | |
|0 0 0 0 0 0 0 0|0 0 0 0|1 1 1 1|1 1 0 0 0 0 0 0|0 0 0 0|1 1 1 1|
|9 8 7 6 5 4 3 2|3 2 1 0|3 2 1 0|1 0 9 8 7 6 5 4|3 2 1 0|5 4 3 2|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| POS3 | PSIG0 |POS|PSIG2| PSIG1 | PSIG3 |PSIG2|
| | | 3 | | | | |
|1 1 0 0 0 0 0 0|0 0 0 0 0 0|1 1|0 0 0|0 0 0 0 0|0 0 0 0 0|0 0 0|
|1 0 9 8 7 6 5 4|5 4 3 2 1 0|3 2|2 1 0|4 3 2 1 0|4 3 2 1 0|5 4 3|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 1: G.723 (6.3 kb/s) bit packing
For the 5.3 kb/s data rate, the header (HDR) bits are always "0 1",
as shown in Fig. 2, to indicate operation at 5.3 kb/s.
Schulzrinne & Casner Standards Track [Page 16]
RFC 3551 RTP A/V Profile July 2003
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LPC |HDR| LPC | LPC | ACL0 |LPC|
| | | | | | |
|0 0 0 0 0 0|0 1|1 1 1 1 0 0 0 0|2 2 1 1 1 1 1 1|0 0 0 0 0 0|2 2|
|5 4 3 2 1 0| |3 2 1 0 9 8 7 6|1 0 9 8 7 6 5 4|5 4 3 2 1 0|3 2|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ACL2 |ACL|A| GAIN0 |ACL|ACL| GAIN0 | GAIN1 |
| | 1 |C| | 3 | 2 | | |
|0 0 0 0 0|0 0|0|0 0 0 0|0 0|0 0|1 1 0 0 0 0 0 0|0 0 0 0 0 0 0 0|
|4 3 2 1 0|1 0|6|3 2 1 0|1 0|6 5|1 0 9 8 7 6 5 4|7 6 5 4 3 2 1 0|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| GAIN2 | GAIN1 | GAIN2 | GAIN3 | GRID | GAIN3 |
| | | | | | |
|0 0 0 0|1 1 0 0|1 1 0 0 0 0 0 0|0 0 0 0 0 0 0 0|0 0 0 0|1 1 0 0|
|3 2 1 0|1 0 9 8|1 0 9 8 7 6 5 4|7 6 5 4 3 2 1 0|4 3 2 1|1 0 9 8|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| POS0 | POS1 | POS0 | POS1 | POS2 |
| | | | | |
|0 0 0 0 0 0 0 0|0 0 0 0|1 1 0 0|1 1 0 0 0 0 0 0|0 0 0 0 0 0 0 0|
|7 6 5 4 3 2 1 0|3 2 1 0|1 0 9 8|1 0 9 8 7 6 5 4|7 6 5 4 3 2 1 0|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| POS3 | POS2 | POS3 | PSIG1 | PSIG0 | PSIG3 | PSIG2 |
| | | | | | | |
|0 0 0 0|1 1 0 0|1 1 0 0 0 0 0 0|0 0 0 0|0 0 0 0|0 0 0 0|0 0 0 0|
|3 2 1 0|1 0 9 8|1 0 9 8 7 6 5 4|3 2 1 0|3 2 1 0|3 2 1 0|3 2 1 0|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 2: G.723 (5.3 kb/s) bit packing
The packing of G.723.1 SID (silence) frames, which are indicated by
the header (HDR) bits having the pattern "1 0", is depicted in Fig.
3.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LPC |HDR| LPC | LPC | GAIN |LPC|
| | | | | | |
|0 0 0 0 0 0|1 0|1 1 1 1 0 0 0 0|2 2 1 1 1 1 1 1|0 0 0 0 0 0|2 2|
|5 4 3 2 1 0| |3 2 1 0 9 8 7 6|1 0 9 8 7 6 5 4|5 4 3 2 1 0|3 2|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 3: G.723 SID mode bit packing
Schulzrinne & Casner Standards Track [Page 17]
RFC 3551 RTP A/V Profile July 2003
4.5.4 G726-40, G726-32, G726-24, and G726-16
ITU-T Recommendation G.726 describes, among others, the algorithm
recommended for conversion of a single 64 kbit/s A-law or mu-law PCM
channel encoded at 8,000 samples/sec to and from a 40, 32, 24, or 16
kbit/s channel. The conversion is applied to the PCM stream using an
Adaptive Differential Pulse Code Modulation (ADPCM) transcoding
technique. The ADPCM representation consists of a series of
codewords with a one-to-one correspondence to the samples in the PCM
stream. The G726 data rates of 40, 32, 24, and 16 kbit/s have
codewords of 5, 4, 3, and 2 bits, respectively.
The 16 and 24 kbit/s encodings do not provide toll quality speech.
They are designed for used in overloaded Digital Circuit
Multiplication Equipment (DCME). ITU-T G.726 recommends that the 16
and 24 kbit/s encodings should be alternated with higher data rate
encodings to provide an average sample size of between 3.5 and 3.7
bits per sample.
The encodings of G.726 are here denoted as G726-40, G726-32, G726-24,
and G726-16. Prior to 1990, G721 described the 32 kbit/s ADPCM
encoding, and G723 described the 40, 32, and 16 kbit/s encodings.
Thus, G726-32 designates the same algorithm as G721 in RFC 1890.
A stream of G726 codewords contains no information on the encoding
being used, therefore transitions between G726 encoding types are not
permitted within a sequence of packed codewords. Applications MUST
determine the encoding type of packed codewords from the RTP payload
identifier.
No payload-specific header information SHALL be included as part of
the audio data. A stream of G726 codewords MUST be packed into
octets as follows: the first codeword is placed into the first octet
such that the least significant bit of the codeword aligns with the
least significant bit in the octet, the second codeword is then
packed so that its least significant bit coincides with the least
significant unoccupied bit in the octet. When a complete codeword
cannot be placed into an octet, the bits overlapping the octet
boundary are placed into the least significant bits of the next
octet. Packing MUST end with a completely packed final octet. The
number of codewords packed will therefore be a multiple of 8, 2, 8,
and 4 for G726-40, G726-32, G726-24, and G726-16, respectively. An