-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🕑 Support playout delay extension #134
Conversation
Testing approach was to run Linux VMs locally and simulate a slow client connection. This takes a couple hours of setup but is pretty straightforward. Note the network device I use is Scenario 1Limit egress traffic to a connection just barely fast enough to handle a 6mbps stream. The 320kbit burst buffer lets the burst of packets on keyframes "back up" and be delivered milliseconds later when there is bandwidth available again, similar to a real rate limited connection. (Note with my test stream there was no packet loss, you may have to tweak your test stream, burst size, and/or rate to achieve similar results).
Tested with sample stream I've been using that is mostly stable white noise with a small changing clock. (This leads to tiny p-frames with large i-frames, which is the scenario causing dropped frames we are trying to address with this change). Outcome with no delay enabled. You can see brief pauses in the clock every two seconds that corresponds with keyframes. (The pauses can be even worse under real conditions, depending on your available bandwidth, type of content, encoder settings, other traffic on your network, etc etc) pull134-nodelay-6mbps-rate-limit.mp4Outcome with min delay of 400ms set. There are no pauses. pull134-delay400ms-6mbps-rate-limit.mp4To cleanup traffic control rules, either reboot or do:
References: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If GitHub's CR tools were good, I'd mark this "approved with suggestions" 😁
TODO
Summary
This PR enables support for the experimental playout delay extension described here: https://webrtc.googlesource.com/src/+/refs/heads/main/docs/native-code/rtp-hdrext/playout-delay
The intention is to test playout delay as a workaround for the issue discussed in #101, at least until we can look deeper at changing Chrome to correctly determine a playout delay.
Requirements
janus_playout_delay_support=true
Other Notes
Suggest trying a minimum in the range of 200-400 and a maximum of at least 2000, but no more than 10,000.
Expected outcome is that rendering will be delayed by the min value set. You can try setting a large minimum to see the effect (e.g. 5000), or look at
chrome://webrtc-internals/
like the following image.This shows a stream with a min playout of 200ms. The delay jumps up to 250ms at one point, but never drops below the configured 200ms min delay.
![image](https://user-images.githubusercontent.com/52513/145920584-2e06b696-befb-4315-8293-7dc0c8c702b8.png)