Skip to content

Commit

Permalink
Reduce traffic smoothing window size
Browse files Browse the repository at this point in the history
Now that we correctly use the peak bitrate for traffic smoothing, we
need to be more careful to not exceed that bitrate. This reduces our max
burst size significantly to achieve that.

For frames larger than would have fit in the 100ms burst window this change
does not significantly change behavior except instead of sending an
initial burst and then trickling out packets we now send a tiny burst
that is 1/10th the size and then trickle. The overall send time for the
frame should remain the same.

For frames small enough to fit in the 100ms burst window but too large
to fit in a 10ms burst window this change does impact behavior, the
send will be smoothed out and the frame may take a few extra
milliseconds to send. In the worst case, instead of a frame being sent
in one big burst at the start of the 100ms burst window, it will now be
smoothed out over 100ms.

This new behavior seems to perform better in all situations. If you have
a fast connection your peak kbps will be much higher than the video kbps
and only minimal smoothing will be applied. If you are streaming at
close to the speed of your connection then significant smoothing will be
applied to keep within your network's capability. Doing this smoothing
at the application level is preferred with RTP over trusting the user's
router and connection to handle large bursts of packets.
  • Loading branch information
danstiner committed Mar 29, 2021
1 parent 18f5c6a commit 2ed3db4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libftl/ftl_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
#define NACK_RTT_AVG_SECONDS 5
#define MAX_STATUS_MESSAGE_QUEUED 10
#define MAX_FRAME_SIZE_ELEMENTS 64 //must be a minimum of 3
#define MAX_XMIT_LEVEL_IN_MS 100 //allows a maximum burst size of 100ms at the target bitrate
#define MAX_XMIT_LEVEL_IN_MS 10 // allows a maximum burst size of 10ms at the peak bitrate
#define VIDEO_RTP_TS_CLOCK_HZ 90000
#define AUDIO_SAMPLE_RATE 48000
#define AUDIO_PACKET_DURATION_MS 20
Expand Down

0 comments on commit 2ed3db4

Please sign in to comment.