為什麼 RTP 的視頻的採樣率是 90kHz ?

語言: CN / TW / HK

-----------------------------------------------------------------------------------------------------------------------------------------

一分鐘快速搭建 rtmpd 服務器: https://blog.csdn.net/freeabc/article/details/102880984

軟件下載地址: http://www.qiyicc.com/download/rtmpd.zip

github 地址:https://github.com/superconvert/smart_rtmpd

-----------------------------------------------------------------------------------------------------------------------------------------

為什麼 RTP 的視頻的採樣率是 90kHz ?

其實我原來一直也有這個疑問,網上也有些解釋,感覺有點太牽強,不完善。今天我就來和大家説一説這個的來歷。

那怎麼樣才更具有説服力呢?當然是引經據典,參看我們的 RFC 了。

其中 rfc3551 中,第 5 小節,是這麼介紹的。

5.  Video

   The following sections describe the video encodings that are defined
   in this memo and give their abbreviated names used for
   identification.  These video encodings and their payload types are
   listed in Table 5.

   All of these video encodings use an RTP timestamp frequency of 90,000
   Hz, the same as the MPEG presentation time stamp frequency.  This
   frequency yields exact integer timestamp increments for the typical
   24 (HDTV), 25 (PAL), and 29.97 (NTSC) and 30 Hz (HDTV) frame rates
   and 50, 59.94 and 60 Hz field rates.  While 90 kHz is the RECOMMENDED
   rate for future video encodings used within this profile, other rates
   MAY be used.  However, it is not sufficient to use the video frame
   rate (typically between 15 and 30 Hz) because that does not provide
   adequate resolution for typical synchronization requirements when
   calculating the RTP timestamp corresponding to the NTP timestamp in
   an RTCP SR packet.  The timestamp resolution MUST also be sufficient
   for the jitter estimate contained in the receiver reports.

   For most of these video encodings, the RTP timestamp encodes the
   sampling instant of the video image contained in the RTP data packet.
   If a video image occupies more than one packet, the timestamp is the
   same on all of those packets.  Packets from different video images
   are distinguished by their different timestamps.

   Most of these video encodings also specify that the marker bit of the
   RTP header SHOULD be set to one in the last packet of a video frame
   and otherwise set to zero.  Thus, it is not necessary to wait for a
   following packet with a different timestamp to detect that a new
   frame should be displayed.

   從上文我們可以看到 90 kHz 等同於 MPEG 呈現時間戳頻率。同時 90 kHz 滿足
   多種制式以及頻段時間戳增長為整數的需要,目的就是減少時間戳偏差。同時 90 kHz
   也滿足 RTCP SR 計算 NTP 同步的需要,也滿足接收報告中 jitter 的估算。
   簡而言之一句話:90 kHz 就是 RTP 視頻時間戳的天選之子!