Skip to content

Commit

Permalink
Pacer docs and bump to 1.1.3 (#361)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidzhao authored Nov 30, 2023
1 parent ea8aa4a commit b0a6c1e
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 4 deletions.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,35 @@ In order to publish from non-file sources, you will have to implement your own `

The SDK takes care of sending the samples to the room.

### Using a pacer

With video publishing, keyframes can be an order of magnitude larger than delta frames.
This size difference can cause a significant increase in bitrate when a keyframe is transmitted, leading to a surge in packet flow.
Such spikes might result in packet loss at the forwarding layer. To maintain a consistent packet flow,
you can enable the use of a [pacer](https://chromium.googlesource.com/external/webrtc/+/master/modules/pacing/g3doc/index.md).

```go
import "github.com/livekit/mediatransportutil/pkg/pacer"

// Control total output bitrate to 10Mbps with 1s max latency
pf := pacer.NewPacerFactory(
pacer.LeakyBucketPacer,
pacer.WithBitrate(10000000),
pacer.WithMaxLatency(time.Second),
)

room, err := lksdk.ConnectToRoom(host, lksdk.ConnectInfo{
APIKey: apiKey,
APISecret: apiSecret,
RoomName: roomName,
ParticipantIdentity: identity,
}, &lksdk.RoomCallback{
ParticipantCallback: lksdk.ParticipantCallback{
OnTrackSubscribed: onTrackSubscribed,
},
}, lksdk.WithPacer(pf))
```

## Receiving webhooks

The Go SDK helps you to verify and decode webhook callbacks to ensure their authenticity.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/go-logr/stdr v1.2.2
github.com/gorilla/websocket v1.5.1
github.com/livekit/mediatransportutil v0.0.0-20231130090133-bd1456add80a
github.com/livekit/protocol v1.9.2
github.com/livekit/protocol v1.9.3
github.com/magefile/mage v1.15.0
github.com/pion/dtls/v2 v2.2.8
github.com/pion/interceptor v0.1.25
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1 h1:jm09419p0lqTkD
github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1/go.mod h1:Rs3MhFwutWhGwmY1VQsygw28z5bWcnEYmS1OG9OxjOQ=
github.com/livekit/mediatransportutil v0.0.0-20231130090133-bd1456add80a h1:xo/CnnItRMmrBygTOln8Sx8BwAWRa8BRML+NQU0sTzM=
github.com/livekit/mediatransportutil v0.0.0-20231130090133-bd1456add80a/go.mod h1:GBzn9xL+mivI1pW+tyExcKgbc0VOc29I9yJsNcAVaAc=
github.com/livekit/protocol v1.9.2 h1:gkKNjVwTbRNO1d5ZxTDHoZrOv4CMvGa1/oPwmCHp8oE=
github.com/livekit/protocol v1.9.2/go.mod h1:8f342d5nvfNp9YAEfJokSR+zbNFpaivgU0h6vwaYhes=
github.com/livekit/protocol v1.9.3 h1:quHq/9dZ60ZDLFcWaY945qznO9ftgdCpHmaLfNEoi0U=
github.com/livekit/protocol v1.9.3/go.mod h1:8f342d5nvfNp9YAEfJokSR+zbNFpaivgU0h6vwaYhes=
github.com/livekit/psrpc v0.5.2 h1:+MvG8Otm/J6MTg2MP/uuMbrkxOWsrj2hDhu/I1VIU1U=
github.com/livekit/psrpc v0.5.2/go.mod h1:cQjxg1oCxYHhxxv6KJH1gSvdtCHQoRZCHgPdm5N8v2g=
github.com/mackerelio/go-osstat v0.2.4 h1:qxGbdPkFo65PXOb/F/nhDKpF2nGmGaCFDLXoZjJTtUs=
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@

package lksdk

const Version = "1.1.2"
const Version = "1.1.3"

0 comments on commit b0a6c1e

Please sign in to comment.