Closed Bug 892395 Opened 9 years ago Closed 8 years ago

Rtsp: calibrate rtp timestamp in the beginning of media streaming.


(Firefox OS Graveyard :: General, defect)

Gonk (Firefox OS)
Not set


(blocking-b2g:1.3+, firefox28 fixed)

blocking-b2g 1.3+
Tracking Status
firefox28 --- fixed


(Reporter: vchang, Assigned: bechen)



(Whiteboard: [FT:RIL])


(2 files, 2 obsolete files)

There are two cases observed so far, 
1. The "200 ok" PLAY response is handled slower than first RTP packet.
We use the rtptime of RTP-Info in "200 OK" as the base timestamp. The timestamp of following RTP packets should refer to it. Otherwise, the timestamp will be incorrect and decoder may not play the streaming properly.      

2. The npt header in "200 ok" PLAY response may have the format "npt:now-", in this case, the rtp packets will be dropped.
Attached file wireshark dump
The attachment is a captured file using wireshark when I streaming the url by vlc.

Please set the filter "rtp" "rtsp" "rtcp" in wireshark.
And focus on the packet No. 82 83 87.

No. 82: 
It's a RTCP packet and it's RTP Timestamp is 609073040

No. 83:
It's a RTSP packet and it carries the RTP Timestamp for both track.
964595889 and 609072026

No. 87: 
It's a RTP packet and it is the first RTP packet for one track. It's RTP timestamp is 609072026. 

In current codebase, |ARTPConnection::parseRTCP| parse the No. 82 packet as the base timestamp. So obviously the No.87 packet will be dropped since its timestamp is negative calculated by No. 82.

We should parse the RTP-Info in No. 83 instead No. 82.

Some reference: 
12.33 RTP-Info
Blocks: b2g-RTSP-1.3
Assignee: nobody → bechen
Attached patch bug-892395.v01.patch (obsolete) — Splinter Review
blocking-b2g: --- → 1.3+
Whiteboard: [FT:RIL]
Attached patch bug-892395.v01.patch (obsolete) — Splinter Review
Hi sworkman:
Could you please review this patch?

Without this patch, the addMediaTimestamp() will drop the first rtp packet and also shift the timestamp of following rtp packets.
Attachment #779093 - Attachment is obsolete: true
Attachment #822207 - Flags: review?(sworkman)
Attachment #822207 - Flags: review?(sworkman) → review+
Attachment #822207 - Attachment is obsolete: true
Attachment #829976 - Flags: review+
Keywords: checkin-needed
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.