WebRTC video fails to play
Categories
(Core :: WebRTC, defect, P2)
Tracking
()
People
(Reporter: cfbraun, Unassigned)
References
Details
Attachments
(2 files)
Steps to reproduce:
Subscribe to a Janus VideoRoom
Actual results:
Video does not play. Attached log file shows that video frames are 'too long into the future'. The problem is confined to a single tab; opening another tab in the same browser to the same page and entering the same room works.
Expected results:
Video should play
The above explanation might be too short: on the testing machine I have two tabs showing the same web page. Entering the room on tab A never works, the log shows dropped frames being 'too long into the future' every time. Entering the same room in the 2nd tab works every time. So there might be some global state that is kept between different RtcPeerConnections?
Comment 2•4 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::WebRTC' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 3•4 years ago
|
||
The severity field is not set for this bug.
:mjf, could you have a look please?
For more information, please visit auto_nag documentation.
I added logging of new_frame.render_time_ms() and time_now to the 'Frame too long into the future' message with interesting results: in the attached log the first received video frame is logged with an arrival time of 161640042. The 'too long into the future' message logs a render_time_ms of 161640757 (which looks reasonable), but a time_now of 86401241. So there is a large difference between the clock used for the arrival time and the clock used by libwebrtc in video_render_frames.cc.
This might be connected to https://hg.mozilla.org/mozilla-central/rev/fdeabccf03769e3c3cb9ad687e2b600495b003ec. The date of the above changeset roughly matches the first occurrence of the problem for us (first reports coming in around New Year 2022).
Looks like the render timestamp is generated from RTCStatsTimestampMakerRealtimeClock::CurrentTime(), but VideoRenderFrames::AddFrame compares it against rtc::TimeMillis. These two clocks seem to use different offsets and can cause the 'future' comparison to fail.
Actually the comment in WebrtcSystemTimeBase() hints that the different offsets are what is wanted, but then the check in VideoRenderFrames::AddFrame either needs to use RTCStatsTimestampMakerRealtimeClock::CurrentTime() or should be disabled.
As rtc::TimeMillis is also used to delay rendering the next frame, the whole concept of using RTCStatsTimestampMakerRealtimeClock::CurrentTime() for the rendering timestamp seems suspicious.
Comment 8•4 years ago
|
||
The fact that this works in one tab but not the other hints that this problem is related to clock drift, perhaps in a very old tab, but it is hard to say for sure. Does this reliably work in new tabs? How long had this tab been open?
Please see my further comments. The problem is caused by using different clock offsets for RTCStatsTimestampMakerRealtimeClock::CurrentTime() and WebrtcSystemTimeBase(). These offsets are initialized when the corresponding clock is used for the first time.
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Comment 10•4 years ago
|
||
Does this still reproduce on the latest 106 build? If so do you have a Janus VideoRoom you can provide access to that reproduces this issue?
Comment 11•3 years ago
|
||
A needinfo is requested from the reporter, however, the reporter is inactive on Bugzilla. Closing the bug as incomplete.
For more information, please visit auto_nag documentation.
Description
•