Packet Structure of RTP

The structure of a RTP packet

**The structure of a RTP packet. e.g. Using UDP**
**rtp packet in wireshark**

The real-time media that is being transferred forms the 'RTP Payload'.
RTP header contains information related to the payload e.g. the source, size, encoding type etc.
However the RTP packet can't be transferred as it is over the network.
For transferring we use a transfer protocol called User Datagram Protocol (UDP).
To transfer the UDP packet over the IP network, we need to encapsulate it with a IP packet.

RTP Payload中存儲著被傳送的實時媒體數(shù)據(jù).

RTP Header

Header Structure of RTP
Sequence Number

The sequence number increments by one for each RTP data packet sent, and may be used by the receiver to detect packet loss and to restore packet sequence.
The loss or out-of-order delivery occurs due network problems.

  • sequence number隨著發(fā)送依次增長+1.
  • 可供receiver來判斷是否有數(shù)據(jù)丟失.
Timestamp

timestamp: 32 bits

The timestamp reflects the sampling instant of the first octet(八位字節(jié)) in the RTP data packet.
The sampling instant must be derived from a clock that increments monotonically and linearly in time to allow synchronization and jitter calculations.

  • Timestamp: 該RTP包中第一個字節(jié)的采樣時刻.
  • 時間戳有一個初始值伤锚,隨著時間而不斷增加.
  • 即使此時沒有包被發(fā)出趋艘,時間戳也會不斷增加.
  • 時間戳是實現(xiàn)去除抖動和實現(xiàn)同步必不可少的.
  • 需要注意的是timestamp的位數(shù):32bit.

Several consecutive(連續(xù)的) RTP packets may have equal timestamps if they are (logically) generated at once, e.g., belong to the same video frame.
Consecutive RTP packets may contain timestamps that are not monotonic(無變化的) if the data is not transmitted in the order it was sampled, as in the case of MPEG interpolated video frames.
(The sequence numbers of the packets as transmitted will still be monotonic.)
So the sequence number is not enough for synchronization.
You already know that in a audio/video session audio and video data are transmitted using separate channels (if you don't know this, please go through applications of RTP).
The receiver matches the video data with corresponding audio data using timestamp.

  • 一些連續(xù)的RTP包可能擁有相同的時間戳, 因為他們屬于同一幀.
  • 音頻和視頻數(shù)據(jù)是分別傳輸?shù)?/strong>.
  • 數(shù)據(jù)的接收者利用時間戳將視頻和音頻進行匹配.

References:
http://www.siptutorial.net/RTP/packetrtp.html
http://www.siptutorial.net/RTP/header.html
http://www.siptutorial.net/RTP/synchro.html
http://blog.csdn.net/ithzhang/article/details/38346557

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末传睹,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌,老刑警劉巖,帶你破解...
    沈念sama閱讀 222,378評論 6 516
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件吮龄,死亡現(xiàn)場離奇詭異,居然都是意外死亡咆疗,警方通過查閱死者的電腦和手機漓帚,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 94,970評論 3 399
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來午磁,“玉大人尝抖,你說我怎么就攤上這事毡们。” “怎么了昧辽?”我有些...
    開封第一講書人閱讀 168,983評論 0 362
  • 文/不壞的土叔 我叫張陵衙熔,是天一觀的道長。 經(jīng)常有香客問我搅荞,道長红氯,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 59,938評論 1 299
  • 正文 為了忘掉前任咕痛,我火速辦了婚禮痢甘,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘茉贡。我一直安慰自己塞栅,他們只是感情好,可當(dāng)我...
    茶點故事閱讀 68,955評論 6 398
  • 文/花漫 我一把揭開白布腔丧。 她就那樣靜靜地躺著放椰,像睡著了一般。 火紅的嫁衣襯著肌膚如雪悔据。 梳的紋絲不亂的頭發(fā)上庄敛,一...
    開封第一講書人閱讀 52,549評論 1 312
  • 那天,我揣著相機與錄音科汗,去河邊找鬼。 笑死绷雏,一個胖子當(dāng)著我的面吹牛头滔,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播涎显,決...
    沈念sama閱讀 41,063評論 3 422
  • 文/蒼蘭香墨 我猛地睜開眼坤检,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了期吓?” 一聲冷哼從身側(cè)響起早歇,我...
    開封第一講書人閱讀 39,991評論 0 277
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎讨勤,沒想到半個月后箭跳,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 46,522評論 1 319
  • 正文 獨居荒郊野嶺守林人離奇死亡潭千,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 38,604評論 3 342
  • 正文 我和宋清朗相戀三年谱姓,在試婚紗的時候發(fā)現(xiàn)自己被綠了。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片刨晴。...
    茶點故事閱讀 40,742評論 1 353
  • 序言:一個原本活蹦亂跳的男人離奇死亡屉来,死狀恐怖路翻,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情茄靠,我是刑警寧澤茂契,帶...
    沈念sama閱讀 36,413評論 5 351
  • 正文 年R本政府宣布,位于F島的核電站慨绳,受9級特大地震影響掉冶,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜儡蔓,卻給世界環(huán)境...
    茶點故事閱讀 42,094評論 3 335
  • 文/蒙蒙 一郭蕉、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧喂江,春花似錦召锈、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,572評論 0 25
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至吉嚣,卻和暖如春梢薪,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背尝哆。 一陣腳步聲響...
    開封第一講書人閱讀 33,671評論 1 274
  • 我被黑心中介騙來泰國打工秉撇, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人秋泄。 一個月前我還...
    沈念sama閱讀 49,159評論 3 378
  • 正文 我出身青樓琐馆,卻偏偏與公主長得像,于是被迫代替她去往敵國和親恒序。 傳聞我的和親對象是個殘疾皇子瘦麸,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 45,747評論 2 361

推薦閱讀更多精彩內(nèi)容