Bug 293139
| Summary: | Non-Compliant RTP Timestamp Clock Rate For Video | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Andy <andy> |
| Component: | WebRTC | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | Major | CC: | ahmad.saleem792, glendonwalkerii, rychouwei, youennf |
| Priority: | P2 | ||
| Version: | Safari 18 | ||
| Hardware: | All | ||
| OS: | macOS 15 | ||
Andy
The video RTP payload exhibits a timestamp scaling mismatch: instead of the mandated 90 kHz (i.e., 1/90000 second per tick) as specified by RFC 3551, it appears to be using an alternative timebase. This non-standard clock resolution is causing synchronization issues in frame alignment and RTCP jitter estimation.
Steps to Reproduce:
1) Utilizing either a sender or a receiver that is able to log rtcp packet NTP and RTP timestamp fields and RTP Packet timestamp fields, track the elapsed time of the video stream against the wall clock.
2) Subtract the elapsed wall clock time from the elapsed video time.
3) Notice that video RTP timestamps are advancing rapidly.
Expected Behavior:
According to RFC 3551, the RTP timestamp for video streams should increment in units of 1/90000 second to properly map to standard video frame rates and perform intermedia time correlation.
Actual Behavior:
Observed video RTP timestamps do not match the 90 kHz precision, suggesting that a different clock rate is being applied, leading to synchronization discrepancies, issues with RTCP report generation and unplayable recordings.
From the provided sender report data below:
Example 1:
Over the duration of 66.25 seconds, RTP elapsed time converted to seconds was 736
1747229722271 ms - 1747229656021 ms = 66.250 seconds
4294691934 - 4228451903 = 66,240,031 rtp ticks
66,240,031 / 90000 = 736.000 seconds
Example 2:
Compare the NPT time and RTP ticks between two video sender reports and calculate the number of RTP ticks expected.
Between the first two sender reports we have 1.302 seconds which should equal 117,180 rtp ticks at 90000 hz.
However there are 1,300,515 rtp ticks for a total of 14.450 seconds.
RAW logging.
Note that audio clock rates are correct.
Elapsed video RTP in seconds versus elapsed npt are very much not at the same rate
2025-05-16 11:27:20,085 - video:Wed, May 14 2025 13:34:16.021 UTC, npt as unix-time ms: 1747229656021, rtp: 4228451903 / 90000.0 = 46982.798922222224, elapsed rtp = 0.0, elapsed npt: 0.0
2025-05-16 11:27:21,380 - video:Wed, May 14 2025 13:34:17.323 UTC, npt as unix-time ms: 1747229657323, rtp: 4229752418 / 90000.0 = 46997.249088888886, elapsed rtp = 14.450166666661971, elapsed npt: 1.302
2025-05-16 11:27:21,841 - video:Wed, May 14 2025 13:34:17.784 UTC, npt as unix-time ms: 1747229657784, rtp: 4230187477 / 90000.0 = 47002.08307777778, elapsed rtp = 19.284155555556936, elapsed npt: 1.763
2025-05-16 11:27:22,439 - video:Wed, May 14 2025 13:34:18.374 UTC, npt as unix-time ms: 1747229658374, rtp: 4230786495 / 90000.0 = 47008.73883333334, elapsed rtp = 25.93991111111245, elapsed npt: 2.353
2025-05-16 11:27:22,891 - video:Wed, May 14 2025 13:34:18.835 UTC, npt as unix-time ms: 1747229658835, rtp: 4231252141 / 90000.0 = 47013.91267777778, elapsed rtp = 31.113755555554235, elapsed npt: 2.814
2025-05-16 11:27:22,982 - audio:Wed, May 14 2025 13:34:18.925 UTC, npt as unix-time ms: 1747229658925, rtp: 2134117931 / 48000.0 = 44460.79022916667, elapsed rtp = 3.022000000004482, elapsed npt: 3.03
2025-05-16 11:27:23,702 - video:Wed, May 14 2025 13:34:19.646 UTC, npt as unix-time ms: 1747229659646, rtp: 4232053001 / 90000.0 = 47022.81112222222, elapsed rtp = 40.01219999999739, elapsed npt: 3.625
2025-05-16 11:27:24,391 - video:Wed, May 14 2025 13:34:20.334 UTC, npt as unix-time ms: 1747229660334, rtp: 4232752286 / 90000.0 = 47030.58095555555, elapsed rtp = 47.78203333332931, elapsed npt: 4.313
2025-05-16 11:27:24,610 - video:Wed, May 14 2025 13:34:20.555 UTC, npt as unix-time ms: 1747229660555, rtp: 4232984324 / 90000.0 = 47033.15915555556, elapsed rtp = 50.36023333333287, elapsed npt: 4.534
2025-05-16 11:27:25,017 - video:Wed, May 14 2025 13:34:20.960 UTC, npt as unix-time ms: 1747229660960, rtp: 4233384109 / 90000.0 = 47037.60121111111, elapsed rtp = 54.80228888888814, elapsed npt: 4.939
2025-05-16 11:27:25,499 - video:Wed, May 14 2025 13:34:21.443 UTC, npt as unix-time ms: 1747229661443, rtp: 4233852311 / 90000.0 = 47042.80345555556, elapsed rtp = 60.0045333333328, elapsed npt: 5.422
2025-05-16 11:27:26,025 - video:Wed, May 14 2025 13:34:21.967 UTC, npt as unix-time ms: 1747229661967, rtp: 4234384357 / 90000.0 = 47048.71507777778, elapsed rtp = 65.91615555555472, elapsed npt: 5.946
2025-05-16 11:27:26,541 - video:Wed, May 14 2025 13:34:22.481 UTC, npt as unix-time ms: 1747229662481, rtp: 4234885861 / 90000.0 = 47054.28734444444, elapsed rtp = 71.4884222222172, elapsed npt: 6.46
2025-05-16 11:27:27,253 - video:Wed, May 14 2025 13:34:23.197 UTC, npt as unix-time ms: 1747229663197, rtp: 4235616622 / 90000.0 = 47062.40691111111, elapsed rtp = 79.6079888888853, elapsed npt: 7.176
2025-05-16 11:27:27,985 - audio:Wed, May 14 2025 13:34:23.929 UTC, npt as unix-time ms: 1747229663929, rtp: 2134358459 / 48000.0 = 44465.80122916667, elapsed rtp = 8.033000000003085, elapsed npt: 8.034
2025-05-16 11:27:28,061 - video:Wed, May 14 2025 13:34:24.004 UTC, npt as unix-time ms: 1747229664004, rtp: 4236417661 / 90000.0 = 47071.307344444445, elapsed rtp = 88.50842222222127, elapsed npt: 7.983
....
2025-05-16 11:28:25,687 - audio:Wed, May 14 2025 13:35:21.629 UTC, npt as unix-time ms: 1747229721629, rtp: 2137127867 / 48000.0 = 44523.49722916666, elapsed rtp = 65.72899999999936, elapsed npt: 65.734
2025-05-16 11:28:25,896 - video:Wed, May 14 2025 13:35:21.838 UTC, npt as unix-time ms: 1747229721838, rtp: 4294258475 / 90000.0 = 47713.98305555555, elapsed rtp = 731.1841333333286, elapsed npt: 65.817
2025-05-16 11:28:26,330 - video:Wed, May 14 2025 13:35:22.271 UTC, npt as unix-time ms: 1747229722271, rtp: 4294691934 / 90000.0 = 47718.79926666667, elapsed rtp = 736.0003444444446, elapsed npt: 66.25
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Ahmad Saleem
@Andy - can you share details whether it was on macOS, iPhone and iPadOS + on which version? If you have reduction or test case to reproduce the issue, it would be quite helpful.
Ahmad Saleem
@Andy - can you share details whether it was on macOS, iPhone and iPadOS + on which version? If you have reduction or test case to reproduce the issue, it would be quite helpful.
Andy
We have reproduced it with most everything that was running 18.4 safari. iphones and MacBooks pros.
Here is the user agent header from my mac book pro:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.4 Safari/605.1.15
macOS Sequoia 15.4.1
As far as reproducing the issue, I imagine any webrtc WHIP session will reproduce the issue. The tricky part is getting to see the numbers being sent in the rtp headers and rtcp sender reports. The rtp headers are generally not encrypted so you may be able to observe them with tools like wireshark. Im using a webrtc capable webserver and added code to print out the safari stream times and elapsed times, along with the rtp scaled timestamps.
If needed , I could set up a server and have it print logging into a web directory.
Thanks!
Andy
rychouwei
same issue
youenn fablet
*** This bug has been marked as a duplicate of bug 292273 ***