question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when parsing SDP answer

See original GitHub issue

After upgrading to version 0.9.14, I am getting the following error when parsing the recieved SDP answer:

Traceback (most recent call last):
  File "error.py", line 45, in <module>
    loop.run_until_complete(error())
  File "/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 573, in run_until_complete
    return future.result()
  File "error.py", line 41, in error
    await pc.setRemoteDescription(RTCSessionDescription(sdp=sdp, type="answer"))
  File "/Users/tobiasfriden/airpelago/dmc-webrtc/lib/python3.7/site-packages/aiortc/rtcpeerconnection.py", line 528, in setRemoteDescription
    ssrc=media.ssrc[0].ssrc,
IndexError: list index out of range

Reverting back go 0.9.13 everything works fine. Minimal example code to reproduce:

import asyncio
from aiortc import RTCPeerConnection, RTCSessionDescription
from aiortc.contrib.media import MediaPlayer

# Received SDP
sdp = """v=0
o=- 3754725498 3754725498 IN IP4 3.121.248.224
s=VideoRoom 1234
t=0 0
a=group:BUNDLE 0
a=msid-semantic: WMS janus
m=video 9 UDP/TLS/RTP/SAVPF 96
c=IN IP4 3.121.248.224
a=recvonly
a=mid:0
a=rtcp-mux
a=ice-ufrag:Mfwz
a=ice-pwd:sPfYombZXNeZn1c5gpHZ27
a=ice-options:trickle
a=fingerprint:sha-256 D2:B9:31:8F:DF:24:D8:0E:ED:D2:EF:25:9E:AF:6F:B8:34:AE:53:9C:E6:F3:8F:F2:64:15:FA:E8:7F:53:2D:38
a=setup:active
a=rtpmap:96 VP8/90000
a=rtcp-fb:96 ccm fir
a=rtcp-fb:96 nack
a=rtcp-fb:96 nack pli
a=rtcp-fb:96 goog-remb
a=rtcp-fb:96 transport-cc
a=candidate:1 1 udp 2013266431 3.121.248.224 10174 typ host
a=candidate:2 1 udp 1677722111 3.121.248.224 10174 typ srflx raddr 172.18.0.2 rport 10174
a=end-of-candidates
"""

async def error():
    player = MediaPlayer("video.m4v")
    track = player.video

    pc = RTCPeerConnection()
    pc.addTrack(track)
    await pc.setLocalDescription(await pc.createOffer())

    await pc.setRemoteDescription(RTCSessionDescription(sdp=sdp, type="answer"))

if __name__ == "__main__":
    loop = asyncio.get_event_loop()
    loop.run_until_complete(error())

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
jlainecommented, Dec 25, 2018

I have pushed out aiortc 0.9.15 which contains both fixes

0reactions
jlainecommented, Dec 25, 2018

You’re welcome, it’s good to have actionable issues which clearly describe the usecase + problem + the relevant SDP.

Read more comments on GitHub >

github_iconTop Results From Across the Web

WebRTC SDP Parsing error with GeckoFX - Stack Overflow
| SDP Parsing Error: Invalid port format(9) specified for transport protocol (Unsupported), parse failed. Why does this occur? What browser version are you ......
Read more >
SDP parsing failure due to lack of wildcard handling for audio ...
Failed to parse audio codecs correctly." This error is related to SDP in "200 OK" from Linphone, which looks like this: SIP/2.0 200...
Read more >
Sdp parse error - Google Groups
I have my native c++ application. While creating session description to call setRemoteDescription(...) , I m noting this error.
Read more >
SDP parsing failed: GatewaySDP: Unrecognized transport ...
Calls from/to CallCentric failed with error: Invalid incoming Gateway SDP: GatewaySDP: Unrecognized transport profile.
Read more >
[Linphone-developers] Incoming call error (Failed to parse SDP)
Content-Type: application/sdp ... session_description parser error for [v=0 ... server will reply with an ACK which Linphone thinks it's malformed (always
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found