'Absolute Send Time' WebRTC extension bug
See original GitHub issueHi, I get the following warning upon the successfull connection of the two peers (but in fact it is an error since it prevent completely the tracks to be sent and received):
[WARNING][2022-06-28 13:00:29,863](72026)aiortc.rtcdtlstransport: RTCDtlsTransport(client) Traceback (most recent call last):
File "/home/bob/ws/modules/streaming-module/venv/lib/python3.8/site-packages/aiortc/rtcdtlstransport.py", line 531, in __run
await self._recv_next()
File "/home/bob/ws/modules/streaming-module/venv/lib/python3.8/site-packages/aiortc/rtcdtlstransport.py", line 630, in _recv_next
await self._handle_rtp_data(data, arrival_time_ms=arrival_time_ms)
File "/home/bob/ws/modules/streaming-module/venv/lib/python3.8/site-packages/aiortc/rtcdtlstransport.py", line 575, in _handle_rtp_data
packet = RtpPacket.parse(data, self._rtp_header_extensions_map)
File "/home/bob/ws/modules/streaming-module/venv/lib/python3.8/site-packages/aiortc/rtp.py", line 710, in parse
packet.extensions = extensions_map.get(extension_profile, extension_value)
File "/home/bob/ws/modules/streaming-module/venv/lib/python3.8/site-packages/aiortc/rtp.py", line 89, in get
values.abs_send_time = unpack("!L", b"\00" + x_value)[0]
struct.error: unpack requires a buffer of 4 bytes
I investigated a bit and I understood that is caused by the RTP extension “Absolute Send Time” (https://webrtc.googlesource.com/src/+/refs/heads/main/docs/native-code/rtp-hdrext/abs-send-time) In the specification it is written that this extension is 4 bytes long, but the code in aiortc/rtp.py seems to ignore this and try to get the extension value as for any other extension. Then this value is unpacked but being too short an exception from the struct package is thrown. You think all this I supposed is right? I can try patching it and sending you a first fix. Have a great day
Issue Analytics
- State:
- Created a year ago
- Comments:9 (2 by maintainers)

Top Related StackOverflow Question
Hi, is there something new to update regarding this one? I experience the same thing when I try to receive the
rtp_data…After I removed this
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\nfrom the offer before I sent it to the master peer, I was able to stream media between the two peers. It looks fine - no delay and good sync of audio-video tracks.