Releases: pion/webrtc
Releases · pion/webrtc
v4.2.2
What's Changed
Special thanks to @AkshayJainG for reporting and diagnosing several panic conditions in the IVF and OGG readers caused by malformed inputs. these fixes improve robustness when handling untrusted or malformed media inputs using ogg reader or ivf reader.
- Update module github.com/pion/rtp to v1.9.0 by @renovate[bot] in #3324
- Simplify interface to handleUnknownRTPPacket by @jech in #3329
- Fix data race in RTX by @JoTurk in #3332
- Add WithRTPSequenceNumber by @JoTurk in #3337
- Implement support for remote offers that are not actpass by @fippo in #3325
- Update module github.com/pion/stun/v3 to v3.1.0 by @renovate[bot] in #3338
- Fix typo in custom-logger example by @boushley in #3340
- Rename dtlsRoleFromRemoteSDP to dtlsRoleFromSDP by @fippo in #3341
- Update pion-to-pion example to clarify differences. by @boushley in #3342
- Fix panics in OGG API by @AkshayJainG @JoTurk in #3346
- Update module github.com/pion/dtls/v3 to v3.0.10 by @renovate[bot] in #3348
- Update module github.com/pion/stun/v3 to v3.1.1 by @renovate[bot] in #3349
- Upgrade to pion/transport v4 by @JoTurk in #3344
- Fix divide by zero in IVF reader by @AkshayJainG @JoTurk in #3353
- Add new repacketize example by @Juliapixel in #3350
- SetConfiguration now updates ICEGatherer's servers by @wrangelvid in #3339
- Ensure candidate gathering promise completes by @boushley in #3347
- Update module github.com/pion/interceptor to v0.1.43 by @renovate[bot] in #3354
New Contributors
- @fippo made their first contribution in #3325
- @Juliapixel made their first contribution in #3350
- @wrangelvid made their first contribution in #3339
Full Changelog: v4.2.1...v4.2.2
v4.2.1
v4.2.0
We are pleased to announce our final and largest release of 2025. This release includes contributions from 69 contributors.
This release also marks a new era for Pion. Going forward, we will publish releases on a regular schedule.
Major new features
RACK
- We are happy to announce that SCTP now includes a RACK implementation, enabled by default. This work is included in pion/sctp#390 and pion/sctp#438, with a reported 71% improvement in maximum throughput and 27% better latency.
ICE Renomination
- Pion now supports ICE renomination It was added in pion/ice#822 and pion/ice#799, and integrated into WebRTC in #3306. It can be enabled via the SettingEngine.
// For advanced use with a custom generator and interval.
se := webrtc.SettingEngine{}
interval := 2 * time.Second
customGen := func() uint32 { return uint32(time.Now().UnixNano()) } // example
if err := se.SetICERenomination(
webrtc.WithRenominationGenerator(customGen),
webrtc.WithRenominationInterval(interval),
); err != nil {
log.Println(err)
}Cryptex
- Pion now supports Cryptex, enabling full encryption of RTP headers and header extensions. This work is included in pion/srtp#324 and pion/sdp#213.
FlexFEC
- FlexFEC has been added, is stable, and is ready for production use. See pion/interceptor#333, #3075, pion/interceptor#330, pion/interceptor#344, and pion/interceptor#383.
ICEAddressRewriteRule
- Pion’s NAT 1:1 API is now deprecated. After years of use, it no longer fits modern deployment models. This change is implemented in pion/ice#834 and #3309.
The new API, SetICEAddressRewriteRules(rules ...ICEAddressRewriteRule) error, rewrites the IP addresses embedded in gathered ICE candidates.
Rule fields (high level):
- External []string: the address or addresses you want to expose
- Matchers: Local, CIDR, or Iface
- Mode: Replace (default) or Append (keep the original and add the rewritten candidate)
- Optional: AsCandidateType (for example, rewrite as srflx)
se := webrtc.SettingEngine{}
_ = se.SetICEAddressRewriteRules(
webrtc.ICEAddressRewriteRule{
Local: "10.0.0.12",
External: []string{"203.0.113.10"},
// Mode omitted, defaults to Replace.
},
)
api := webrtc.NewAPI(webrtc.WithSettingEngine(se))
// pc, _ := api.NewPeerConnection(...)// For more advanced use.
se := webrtc.SettingEngine{}
se.SetICEAddressRewriteRules(
// Allow eth0 (map RFC1918 to public 203.0.113.10)
webrtc.ICEAddressRewriteRule{
Iface: "eth0",
CIDR: "10.0.0.0/8",
External: []string{"203.0.113.10"},
Mode: webrtc.ICEAddressRewriteReplace,
},
// Allow eth1 (map 192.168/16 to public 198.51.100.20)
webrtc.ICEAddressRewriteRule{
Iface: "eth1",
CIDR: "192.168.0.0/16",
External: []string{"198.51.100.20"},
Mode: webrtc.ICEAddressRewriteReplace,
},
// Catch-all: drop any other IPv4 host candidates
webrtc.ICEAddressRewriteRule{
CIDR: "0.0.0.0/0",
Mode: webrtc.ICEAddressRewriteReplace,
External: nil, // drop
},
// Catch-all: drop any other IPv6 host candidates
webrtc.ICEAddressRewriteRule{
CIDR: "::/0",
Mode: webrtc.ICEAddressRewriteReplace,
External: nil, // drop
},
)SVT-AV1
- Adds a new AV1 video encoder to pion/mediadevices backed by SVT-AV1: pion/mediadevices#660.
HEVC reader and writer
-
pkg/media/h265readerparses an H.265/HEVC Annex-B byte stream (start-code delimited) into NAL units you can work with.pkg/media/h265writertakes H.265 RTP payloads (RFC 7798) and writes them back out as an Annex-B bytestream, which is useful for recording and archiving.
New OGG Reader API
-
A series of improvements to oggreader:
- #3301 adds OpusTags support via
ParseOpusTags, enabling access to artist, title, and vendor comments. - #3299 expands
ParseOpusHeadto parse Opus channel mappings for multichannel layouts. - #3300 updates oggreader to handle multi-track Ogg by routing pages by serial and introducing
NewWithOptionsalong with richer page and header APIs. - #3302 validates the full flow by streaming single-track and multi-track Ogg with a playlist and metadata over DataChannel control, while audio remains on the RTP track.
- #3301 adds OpusTags support via
More great features
- Do not discard SEI NALs for H264/H265 — #3313
- Use ping-pong buffer for batch conn — pion/transport#363
- Add CanTrickleICECandidates — #3283
- Add nohost gather policy — #3305
- Make Allocation/Permission lifetime configurable — pion/turn#495
- RFC: Add a configurable sized nonce generator — pion/turn#460
- Add AudioPlayoutStatsProvider interface for getting media-playout stats — #3234
- Expose stats ID for use in interceptor factories — #3249
- Allow IVFWriter Width/Height to be modified — #3219
- Allow IVFWriter Framerate to be modified — #3220
New Examples
- Add ice-proxy example (2) — #3165
- Add Play from disk ogg playlist example — #3302
- Add examples/encrypt-decrypt — pion/srtp#353
- Add simple datachannel example with demo.html — #3252
- Add real-time encoder integration example — pion/bwe-test#99
- Add gocv-to-webrtc — pion/example-webrtc-applications#370
- Create examples/data-channels-detach-create — #3225
Major bug fixes
- Fix a deadlock in TaskLoop — pion/ice#840
- Fix a deadlock with Abort — pion/sctp#441
- Fix nack deadlocks from writers — pion/interceptor#387
- Fix race condition in setSelectedPair — pion/ice#826
- Fix memory leak with nackCountLogs — pion/interceptor#386
- Fix a leak with pop in pending_queue — pion/sctp#401
- Fix PacketsReceived underflow — pion/interceptor#389
- Fix RTP timestamp drift in WriteSample — #3312
- Prevent negative intervals — pion/dtls#760
- Do not block on SCTP accept if the transport is aborted — #3308
- Fix infinite loop when current time equals deadline — pion/transport#359
- Fix zero-delta case in overuse detector — pion/interceptor#369
- Fix off-by-one in TwoByteHeaderExtension.Set — pion/rtp#335
- Fix off-by-one in OneByteHeaderExtension.Set — pion/rtp#334
- Fix unmarshalling extension-only packet — pion/rtp#325
- Fix padding overflow with PacketFactory — pion/interceptor#338
- Fix RTPSender.SetReadDeadline crash — #3224
- fix track.unbind panic — pion/mediadevices#634
- Do not invoke OnBufferedAmountLow after close — #3291
- Emit a disconnected state before failing — pion/ice#846
- Fix error reporting in SendIndication handler — pion/turn#466
- Fix sender/receiver reports in whip-whep example — #3167
- Permissively parse SDPs unless completely invalid — #3297
- Warn on non-zero reliability parameter for reliable channels — pion/datachannel#263
- Assert DONT-FRAGMENT behavior in Server (1) — pion/turn#494
- Assert DONT-FRAGMENT behavior in Server (2) — pion/turn#493
- Add Unknown Attribute Handler — pion/turn#486
Performance improvement
- Optimize slice allocation in UDPMuxDefault — pion/ice#788
- Add MarshalTo for zero-allocation extension marshalling — pion/rtp#344
- Preallocate slice capacity in Registry.Build() — pion/interceptor#353
- use atomic instead of lock in sequencer — pion/rtp#343
- Use atomic...
v4.1.8
v4.1.7
Changelog
- f3177f8 Option to ignore rid pause in
a=simulcast:recv - d8e8182 Update module github.com/pion/rtp to v1.8.26 (#3288)
- c6b288f Add WithDirectPTS option for precise RTP timestamp (#3287)
- 210cd95 Add CanTrickleICECandidates
- aac830d Update module github.com/pion/ice/v4 to v4.0.13 (#3285)
- c71cc75 Update module github.com/pion/dtls/v3 to v3.0.8 (#3284)
- 8242681 Update module github.com/pion/ice/v4 to v4.0.12 (#3281)
- 4b59cf9 Support advertising ICE trickling (#3097)
- 71b8a13 Don't drop packets when probing Simulcast
- c457479 Update module github.com/pion/srtp/v3 to v3.0.9 (#3280)
- 67d948b Update module github.com/pion/sctp to v1.8.41 (#3279)
- 39210f1 Update module github.com/pion/ice/v4 to v4.0.11 (#3278)
- ed9f7fa Add an error for sdp unmarshalling error
- 5552def Fix and improve a flaky test (#3275)
- 418e18c Update actions/checkout action to v6
- e6d249e Added option to configure DTLS Cipher Suites
- d32d5cd Fix a flaky test
- ae65995 Add deterministic NACK/RTX reproduction test (#3270)
- e710dae Refactor streamsForSSRC to return struct
- 5eb9d49 Fix race in test
- e7e3b36 Consider first packet when reading Simulcast IDs (#3144)
- 17287fd Fix flaky test TestPeerConnection_Media_Sample
- 27a8f9b Improve trickle-ice example
- a4c8b34 Update module github.com/pion/interceptor to v0.1.42 (#3266)
- 157d90a Update module github.com/pion/turn/v4 to v4.1.3 (#3265)
- 87b21be Update module github.com/pion/transport/v3 to v3.1.1 (#3262)
- 1840a5f Update module github.com/pion/transport/v3 to v3.1.0
- 8b9583c Add whip-whep-like example
- 7354d59 Fix a rare race in peerconnection_go_test
- 8b43c73 Update dependency node to v24 (#3256)
- c24d2d4 Update module github.com/pion/turn/v4 to v4.1.2 (#3257)
- 49a4074 Expose stats ID for use in interceptor factories
- 41e0480 Update module github.com/pion/rtp to v1.8.25 (#3254)
- 69d77e7 Update module github.com/pion/stun/v3 to v3.0.1 (#3255)
- fe44e78 Improve custom-logger README (#3253)
- 919c686 Add simple datachannel example with demo.html (#3252)
- 8f7e057 Improve the data-channels example
- 7d8a700 Fix test race
- 041530f Update CI configs to v0.11.32
- 030bbf1 Update module github.com/pion/rtp to v1.8.24
- 6886103 Update module github.com/pion/rtcp to v1.2.16 (#3244)
v4.1.6
v4.1.5
Changelog
- 0575dfb Add interface for getting media-playout stats
- bf15721 Update module github.com/pion/transport/v3 to v3.0.8
- 041211f Update module github.com/pion/interceptor to v0.1.41
- 706c75b Update module github.com/pion/srtp/v3 to v3.0.8
- 43976dc Update CI configs to v0.11.29
- e0181e9 Update TestPeerConnection_SessionID to run on WASM
- 5a0e56e Prefer makezero with a cap
- 9acbc66 Cleanup statsGetter after peer is closed
- 4c1261f Add inbound-rtp stats
- 370412f Improve code cov
- 7f1ab45 Remove unused file
- 39d1b3c Apply go modernize suggestions
- 781ff73 Create examples/data-channels-detach-create
- f5fd0fa Update dependency @roamhq/wrtc to v0.9.1
- 6ef2888 Fix RTPSender.SetReadDeadline crash
- 634a904 Fire OnBufferedAmountLow in a goroutine
- 1527bfa Allow IVFWriter Framerate to be modified
- cf7625d Allow IVFWriter Width/Height to be modified
- 882f699 Update actions/setup-node action to v5
- e9efed4 Fix trailing space in rtcp-fb with no Parameter
- 457679c Update module github.com/pion/rtp to v1.8.22
- 3bb8fce Update module github.com/pion/sdp/v3 to v3.0.16
- 4eebb3e Update actions/checkout action to v5
- 5b098de Update CI configs to v0.11.26
- cda9130 Update CI configs to v0.11.25
- e7183f9 Update CI configs to v0.11.24
- c376d0e Match codec order of remote peer
- 42b3cfd Update module github.com/stretchr/testify to v1.11.1
- 2af60a4 Filter unattached RTX when getting codecs
- 123f138 Update module github.com/stretchr/testify to v1.11.0
- 4b37165 Tests to ensure proper direction in SDP
- 6424d85 Consider remote direction in add track
- 469ca2c Disallow incompatible transceiver directions
- 2299a71 Add opt control transceiver re-use in recvonly
- 3e84081 Add partialMatch codecs to transceiver from remote
- c82d96c Remove RTX codec if no primary
v4.1.4
Changelog
- 8efd17e Do not create receiver for ealy media in offerer
- 29e1e00 Update module github.com/pion/turn/v4 to v4.1.1
- afcb348 Add ice-proxy example
- 1557d31 Update CI configs to v0.11.22
- 22cf05c Upgrade to golangci-lint@v2
- 941b741 Update module github.com/pion/dtls/v3 to v3.0.7
- bea05f6 Update module github.com/pion/srtp/v3 to v3.0.7
- 4f1a287 Update golang Docker tag to v1.25
- 7a94394 Log error when Read is used with simulcast
- 5c3d582 WHIP-WHEP example improvements
- f06b6bc Update module github.com/pion/sdp/v3 to v3.0.15
- 1355f02 Update module github.com/pion/rtp to v1.8.21
v3.3.6
v4.1.3
Changelog
- 4c1af4c H265 reader & writer
- e602e15 Update module github.com/pion/rtp to v1.8.20
- 4f67c90 Replace custom atomicBool with sync/atomic.Bool
- 887f5c6 Add sender receiver report
- d3151fe Update module github.com/pion/logging to v0.2.4
- 9b1ca73 Update dependency @roamhq/wrtc to ^0.9.0
- 6874548 Update CI configs to v0.11.20
- 22dd7b7 Replace interface{} with any
- f94e1be Update module github.com/pion/sdp/v3 to v3.0.14
- 86e4719 Update module github.com/pion/srtp/v3 to v3.0.6
- ddae46a Update module github.com/pion/rtp to v1.8.19