⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rfc3640.txt

📁 完整的RTP RTSP代码库
💻 TXT
📖 第 1 页 / 共 5 页
字号:
   A packet SHALL carry either one or more complete Access Units, or a   single fragment of an Access Unit.  Fragments of the same Access Unit   have the same time stamp but different RTP sequence numbers.  The   marker bit in the RTP header is 1 on the last fragment of an Access   Unit, and 0 on all other fragments.3.2.3.2.  Interleaving   Unless prohibited by the signaled mode, a sender MAY interleave   Access Units.  Receivers that are capable of receiving modes that   support interleaving MUST be able to decode interleaved Access Units.   When a sender interleaves Access Units, it needs to provide   sufficient information to enable a receiver to unambiguously   reconstruct the original order, even in the case of out-of-order   packets, packet loss or duplication.  The information that senders   need to provide depends on whether or not the Access Units have a   constant time duration.  Access Units have a constant time duration,   if:   TS(i+1) - TS(i) = constant       for any i, where:          i indicates the index of the AU in the original order, and          TS(i) denotes the time stamp of AU(i)   The MIME parameter "constantDuration" SHOULD be used to signal that   Access Units have a constant time duration; see section 4.1.   If the "constantDuration" parameter is present, the receiver can   reconstruct the original Access Unit timing based solely on the RTP   timestamp and AU-Index-delta.  Accordingly, when transmitting Access   Units of constant duration, the AU-Index, if present, MUST be set tovan der Meer, et al.        Standards Track                    [Page 16]RFC 3640         Transport of MPEG-4 Elementary Streams    November 2003   the value 0.  Receivers of constant duration Access Units MUST use   the RTP timestamp to determine the index of the first AU in the RTP   packet.  The AU-Index-delta header and the signaled   "constantDuration" are used to reconstruct AU timing.   If the "constantDuration" parameter is not present, then senders MAY   signal AUs of constant duration by coding the AU-Index with zero in   each RTP packet.  In the absence of the constantDuration parameter   receivers MUST conclude that the AUs have constant duration if the   AU-index is zero in two consecutive RTP packets.   When transmitting Access Units of variable duration, then the   "constantDuration" parameter MUST NOT be present, and the transmitter   MUST use the AU-Index to encode the index information required for   re-ordering, and the receiver MUST use that value to determine the   index of each AU in the RTP packet.  The number of bits of the AU-   Index field MUST be chosen so that valid index information is   provided at the applied interleaving scheme, without causing problems   due to roll-over of the AU-Index field.  In addition, the CTS-delta   MUST be coded in the AU header for each non-first AU in the RTP   packet, so that receivers can place the AUs correctly in time.   When interleaving is applied, a de-interleave buffer is needed in   receivers to put the Access Units in their correct logical   consecutive decoding order.  This requires the computation of the   time stamp for each Access Unit.  In case of a constant time duration   per Access Unit, the time stamp of the i-th access unit in an RTP   packet with RTP time stamp T is calculated as follows:   Timestamp[0] = T   Timestamp[i, i > 0] = T +(Sum(for k=1 to i of (AU-Index-delta[k]                         + 1))) * access-unit-duration   When AU-Index-delta is always 0, this reduces to T + i * (access-   unit-duration).  This is the non-interleaved case, where the frames   are consecutive in decoding order.  Note that the AU-Index field   (present for the first Access Unit) is indeed not needed in this   calculation.3.2.3.3.  Constraints for Interleaving   The size of the packets should be suitably chosen to be appropriate   to both the path MTU and the capacity of the receiver's de-interleave   buffer.  The maximum packet size for a session SHOULD be chosen to   not exceed the path MTU.van der Meer, et al.        Standards Track                    [Page 17]RFC 3640         Transport of MPEG-4 Elementary Streams    November 2003   To allow receivers to allocate sufficient resources for de-   interleaving, senders MUST provide the information to receivers as   specified in this section.   AUs enter the decoder in decoding order.  The de-interleave buffer is   used to re-order a stream of interleaved AUs back into decoding   order.  When interleaving is applied, the decoding of "early" AUs has   to be postponed until all AUs that precede it in decoding order are   present.  Therefore, these "early" AUs are stored in the de-   interleave buffer.  As an example in Figure 6, the interleaving   pattern from section 2.5 is considered.                             +--+--+--+--+--+--+--+--+--+--+--+-   Interleaved AUs           | 0| 3| 6| 1| 4| 7| 2| 5| 8| 9|12|..                             +--+--+--+--+--+--+--+--+--+--+--+-   Storage of "early" AUs         3  3  3  3  3  3                                     6  6  6  6  6  6                                           4  4  4                                              7  7  7                                                            12 12   Figure 6: Storage of "early" AUs in the de-interleave buffer per             interleaved AU.   AU(3) is to be delivered to the decoder after AU(0), AU(1) and AU(2);   of these AUs, AU(2) arrives from the network last and hence AU(3)   needs to be stored until AU(2) is present in the pattern.  Similarly,   AU(6) is to be stored until AU(5) is present, while AU(4) and AU(7)   are to be stored until AU(2) and AU(5) are present, respectively.   Note that the fullness of the de-interleave buffer varies in time.   In Figure 6, the de-interleave buffer contains at most 4, but often   less AUs.   So as to give a rough indication of the resources needed in the   receiver for de-interleaving, the maximum displacement in time of an   AU is defined.  For any AU(j) in the pattern, each AU(i) with i<j   that is not yet present can be determined.  The maximum displacement   in time of an AU is the maximum difference between the time stamp of   an AU in the pattern and the time stamp of the earliest AU that is   not yet present.  In other words, when considering a sequence of   interleaved AUs, then:   Maximum displacement = max{TS(i) - TS(j)}       for any i and any j>i, where:          i and j indicate the index of the AU in the interleaving                pattern, and          TS denotes the time stamp of the AU.van der Meer, et al.        Standards Track                    [Page 18]RFC 3640         Transport of MPEG-4 Elementary Streams    November 2003   As an example in Figure 7, the interleaving pattern from section 2.5   is considered.  For each AU in the pattern, the index is given of the   earliest of any earlier AUs not yet present.  Hence for each AU(n) in   the interleaving pattern the smallest index k (with k<n) of not yet   delivered AUs is indicated.  A "-" indicates that all previous AUs   are present.  If the AU period is constant, the maximum displacement   equals 5 AU periods, as found for AU(6) and AU(7).                                 +--+--+--+--+--+--+--+--+--+--+--+-   Interleaved AUs               | 0| 3| 6| 1| 4| 7| 2| 5| 8| 9|12|..                                 +--+--+--+--+--+--+--+--+--+--+--+-   Earliest not yet present AU     -  1  1  -  2  2  -  -  -  - 10   Figure 7: For each AU in the interleaving pattern, the earliest of             any earlier AUs not yet present   When interleaving, senders MUST signal the maximum displacement in   time during the session via the MIME format parameter   "maxDisplacement"; see section 4.1.   An estimate of the size of the de-interleave buffer is found by   multiplying the maximum displacement by the maximum bit rate:   size(de-interleave buffer) = {(maxDisplacement) * Rate(max)} / (RTP                                clock frequency),       where:          Rate(max) is the maximum bit-rate of the transported stream.   Note that receivers can derive Rate(max) from the MIME format   parameters streamType, profile-level-id, and config.   However, this calculation estimates the size of the de-interleave   buffer and the required size may differ from the calculated value.   If this calculation under-estimates the size of the   de-interleave buffer, then senders, when interleaving, MUST signal a   size of the de-interleave buffer via the MIME format parameter   "de-interleaveBufferSize"; see section 4.1.  If the calculation   over-estimates the size of the de-interleave buffer, then senders,   when interleaving, MAY signal a size of the de-interleave buffer via   the MIME format parameter "de-interleaveBufferSize".van der Meer, et al.        Standards Track                    [Page 19]RFC 3640         Transport of MPEG-4 Elementary Streams    November 2003   The signaled size of the de-interleave buffer MUST be large enough to   contain all "early" AUs at any point in time during the session.   That is:   minimum de-interleave buffer size = max [sum {if TS(i) > TS(j) then                                       AU-size(i) else 0}]       for any j and any i<j, where:          i and j indicate the index of an AU in the interleaving                pattern,          TS(i) denotes the time stamp of AU(i), and          AU-size(i) denotes the size of AU(i) in number of octets.   If the "de-interleaveBufferSize" parameter is present, then the   applied buffer for de-interleaving in a receiver MUST have a size   that is at least equal to the signaled size of the de-interleave   buffer, else a size that is at least equal to the calculated size of   the de-interleave buffer.   No matter what interleaving scheme is used, the scheme must be   analyzed to calculate the applicable maxDisplacement value, as well   as the required size of the de-interleave buffer.  Senders SHOULD   signal values that are not larger than the strictly required values;   if larger values are signaled, the receiver will buffer excessively.   Note that for low bit-rate material, the applied interleaving may   make packets shorter than the MTU size.3.2.3.4.  Crucial and Non-Crucial AUs with MPEG-4 System Data   Some Access Units with MPEG-4 system data, called "crucial" AUs,   carry information whose loss cannot be tolerated, either in the   presentation or in the decoder.  At each crucial AU in an MPEG-4   system stream, the stream state changes.  The stream-state MAY remain   constant at non-crucial AUs.  In ISO/IEC 14496-1, MPEG-4 system   streams use the AU_SequenceNumber to signal stream states.   Example: Given three AUs, AU1 = "Insertion of node X", AU2 = "Set   position of node X", AU3 = "Set position of node X".  AU1 is crucial,   since if it is lost, AU2 cannot be executed.  However, AU2 is not   crucial, since AU3 can be executed even if AU2 is lost.   When a crucial AU is (possibly) lost, the stream is corrupted.  For   example, when an AU is lost and the stream state has changed at the   next received AU, then it is possible that the lost AU was crucial.   Once corrupted, the stream remains corrupted until the next random   access point.  Note that loss of non-crucial AUs does not corrupt the   stream.  When a decoder starts receiving a stream, the decoder MUSTvan der Meer, et al.        Standards Track                    [Page 20]RFC 3640         Transport of MPEG-4 Elementary Streams    November 2003   consider the stream corrupted until an AU is received that provides a   random access point.   An AU that provides a random access point, as signaled by the RAP-   flag, may or may not be crucial.  Non-crucial RAP AUs provide a   "repeated" random access point for use by decoders that recently   joined the stream or that need to re-start decoding after a stream   corruption.  Non-crucial RAP AUs MUST include all updates since the   last crucial RAP AU.   Upon receiving AUs, decoders are to react as follows:   a) if the RAP-flag is set to 1 and the stream-state changes, then the      AU is a crucial RAP AU, and the AU MUST be decoded.   b) if the RAP-flag is set to 1 and the stream state does not change,      then the AU is a non-crucial RAP AU, and the receiver SHOULD      decode it if the stream is corrupted.  Otherwise, the decoder MUST      ignore the AU.   c) if the RAP-flag is set to 0, then the AU MUST be decoded, unless      the stream is corrupted, in which case the AU MUST be ignored.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -