Maximum RTP packet size

208 views
Skip to first unread message

Afonso Vilalonga

unread,
Aug 23, 2024, 10:45:42 AM8/23/24
to discuss-webrtc

Hello,

I have been exploring WebRTC to understand it better and developed a simple WebRTC application consisting of a Go Pion app and a JavaScript app running in the browser. This application sends a video stream from the JavaScript app to the Go Pion app.  

In the past, I noticed (from testing other applications I have developed) that between two Go Pion instances, RTP packets have a maximum size of 1200 bytes. However, when observing the RTP packets received by the Go Pion app from the JavaScript side, the packets had a maximum size of 1198 bytes. I tested this using the encoded transform API (which allowed me to define the frame size) and, using it, determined the maximum size for each frame before it would be split into two RTP packets. I found that the maximum size of the frame would be 1174 bytes, resulting in an RTP packet of 1198 bytes. If the frame size was 1175 bytes, I would receive the frame in two RTP packets of 611 and 612 bytes, respectively.

My question is, why am I not receiving RTP packets with a size of 1200 bytes, as I do when the connection is between two Go Pion app instances? Is there something I am missing or did wrong? By the way, the browser I used was Chrome, and the frames were encoded VP8 frames.  





Philipp Hancke

unread,
Aug 23, 2024, 10:50:07 AM8/23/24
to discuss...@googlegroups.com
libWebRTC tries to stick to a maximum packet size of 1200 bytes (arbitrary but battle-tested).
If you negotiate RTX this means your maximum packetization size will be two bytes less, same for the header extensions.

--
This list falls under the WebRTC Code of Conduct - https://webrtc.org/support/code-of-conduct.
---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/34b5e6e6-5c1b-4b7f-a00d-9cafaa94c492n%40googlegroups.com.

Afonso Vilalonga

unread,
Aug 26, 2024, 2:56:59 AM8/26/24
to discuss-webrtc
Thank you for your answer! 

Is RTX negotiated by default?  

Reply all
Reply to author
Forward
0 new messages