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.

aiortc and Alexa.RTCSessionControllerInterface

See original GitHub issue

I’m trying to use aiortc to serve video to Amazon Alexa’s RTCSessionControllerInferface (https://developer.amazon.com/en-US/docs/alexa/device-apis/alexa-rtcsessioncontroller.html)

The SDP I receive is this:

v=0
o=- 3824376089 3824376089 IN IP4 0.0.0.0
s=a 2 z
c=IN IP4 0.0.0.0
t=0 0
a=group:BUNDLE audio0 video0
m=audio 1 UDP/TLS/RTP/SAVPF 96 0
a=candidate:1 1 UDP 2013266431 3.250.43.172 50101 typ host
a=candidate:2 1 TCP 1015021823 3.250.43.172 9 typ host tcptype active
a=candidate:1 2 UDP 2013266430 3.250.43.172 56409 typ host
a=candidate:2 2 TCP 1015021822 3.250.43.172 9 typ host tcptype active
a=candidate:3 1 TCP 1010827519 3.250.43.172 46500 typ host tcptype passive
a=candidate:3 2 TCP 1010827518 3.250.43.172 48985 typ host tcptype passive
a=setup:actpass
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=rtpmap:96 opus/48000/2
a=rtcp:9 IN IP4 0.0.0.0
a=rtcp-mux
a=sendrecv
a=mid:audio0
a=ssrc:3458962346 cname:user3441999428@host-c15765d
a=ice-ufrag:/yto
a=ice-pwd:AuahTawelYzLoadB5TAg7/
a=fingerprint:sha-256 8F:7B:D2:29:93:75:EA:18:81:56:9A:78:9C:F3:B3:67:C6:2F:25:0D:67:13:AA:5C:FF:38:39:22:04:70:C8:06
m=video 1 UDP/TLS/RTP/SAVPF 99
a=candidate:1 1 UDP 2013266431 3.250.43.172 50101 typ host
a=candidate:3 1 TCP 1010827519 3.250.43.172 46500 typ host tcptype passive
a=candidate:2 1 TCP 1015021823 3.250.43.172 9 typ host tcptype active
a=candidate:3 2 TCP 1010827518 3.250.43.172 48985 typ host tcptype passive
a=candidate:1 2 UDP 2013266430 3.250.43.172 56409 typ host
a=candidate:2 2 TCP 1015021822 3.250.43.172 9 typ host tcptype active
b=AS:2500
a=setup:actpass
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=rtpmap:99 H264/90000
a=rtcp:9 IN IP4 0.0.0.0
a=rtcp-mux
a=sendrecv
a=mid:video0
a=rtcp-fb:99 nack
a=rtcp-fb:99 nack pli
a=rtcp-fb:99 ccm fir
a=ssrc:4150294130 cname:user3999939428@host-c12365d
a=ice-ufrag:/yto
a=ice-pwd:AtyuTPJqlYzLoadB5TAg7/
a=fingerprint:sha-256 8F:7B:D2:29:93:75:EA:18:81:56:9A:78:9C:F3:B3:67:C6:2F:25:0D:67:13:AA:5C:FF:38:39:22:04:70:C8:06

when I try to send back an rtsp stream I get back:

ERROR:aiohttp.server:Error handling request
Traceback (most recent call last):
  File "/home/x/github/core/venv/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/home/x/github/core/venv/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "server.py", line 63, in smart_home
    await pc.setRemoteDescription(offer)
  File "/home/x/github/core/venv/lib/python3.8/site-packages/aiortc/rtcpeerconnection.py", line 823, in setRemoteDescription
    assert len(common)
AssertionError

My code is :

async def smart_home(request):
    pc = RTCPeerConnection()

    audio, video = create_local_tracks(args.play_from)
    await pc.setRemoteDescription(offer)
    for t in pc.getTransceivers():
        if t.kind == "audio" and audio:
            pc.addTrack(audio)
        elif t.kind == "video" and video:
            pc.addTrack(video)

    answer = await pc.createAnswer()
    await pc.setLocalDescription(answer)

def create_local_tracks(play_from):
    global relay, webcam
    player = MediaPlayer("rtsp://web_cam_url")
    return player.audio, player.video

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jlainecommented, Mar 14, 2022

I had a look at this and I think that in the absence of a profile, we should consider the remote party’s codec to be compatible so this looks like a bug indeed.

0reactions
github-actions[bot]commented, Nov 12, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

aiortc - Bountysource
aiortc. WebRTC and ORTC implementation for Python using asyncio ... I'm trying to use aiortc to serve video to Amazon Alexa's RTCSessionControllerInferface ...
Read more >
aiortc — aiortc documentation
aiortc is a library for Web Real-Time Communication (WebRTC) and Object Real-Time Communication (ORTC) in Python. It is built on top of asyncio...
Read more >
[Subtask]: remove mutable buffer node in appendable block
aiortc and Alexa.RTCSessionControllerInterface, 8, 2021-03-10, 2022-08-06 ; EDDSystem.sqlite is just too big, 7, 2022-02-12, 2022-10-05.
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