Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
    I had a look at the examples in the official git repo of Aiortc, however in all the examples there, webrtc is established using client.js which is JavaScript. Can some point me to code where it is done in python by Aiortc?
    Thanks for your help in advance 😃
    has anyone used aiortc for a proxy server? or care to sanity check that it makes sense to do that? my goal is to manage separate connections with streaming users (in which case the server is receiving) and viewing users (in which case the server is sending), and be able to write logic re: who receives what. if anyone has even a super simple example of just forwarding video received from one connection to another, that would be super helpful.
    Prabhudatta Das
    @jlaine Is there any example you can point me for a simple streaming speech to text ; I am struggling to do that following the https://github.com/aiortc/aiortc/tree/main/examples/server ; where on the server side, I am trying to add speech to text api call and sending it back via data channel ; any blog , direction will be appreciated
    Guys, hi. I want to create a server for video-chat. The idea is to have several peer-to-peer chatting users. Can someone help me and point to any tutorials? Or give hint or advises how to do it?
    Mohammad Moallemi

    Does aiortc support one to one, one way broadcasting and call?
    Like one is streaming and one joins and starts watching

    I've read stuff that aiortc doesn't support that! Please answer, tnx

    Ugur B.


    I want to play with the aiortc source code, what is the best way for local development. (I am on Mac.) Should i install the framework with "pip install ." and then do the same thing after each change?

    I get error like"Application provided invalid,non monotonically increasing dts to muxer in stream" i don't know what's wrong
    Mohammad Moallemi

    Hi Everyone,

    I hope you are well

    I have this issue with audio tracks in which some of the audio frames/packets are missing and not sent to the user or encoder.

    More details in GitHub issue:


    Any help is appreciated

    Hi, I have an aiortc audio sending webap which works to another computer, but not my mobile safari, how can I even debug what the issue is ?
    i'm streaming audio, it says connected, but I hear no audio on the iPhone
    bruno messias
    Hi. I've been working in a webrtc streaming and everything It's working fine. However, I want to send videostreamtrack to youtube. I looked into the aiortc examples and what I'm trying to do is something similar to this
    from av import VideoFrame
    from aiortc.contrib.media import MediaRecorder
    from aiortc.mediastreams import AudioStreamTrack, VideoStreamTrack
    import av
    import numpy as np
    import asyncio
    def run(coro):
            return asyncio.get_event_loop().run_until_complete(coro)
    class RTCServer(VideoStreamTrack):
        def __init__(self,):
            self.image = np.random.randint(
                    0, 255, (640, 360, 3),
        async def recv(self):
            pts, time_base = await self.next_timestamp()
            image = np.random.randint(
                    0, 255, (640, 360, 3),
            av_frame = VideoFrame.from_ndarray(image)
            av_frame.pts = pts
            av_frame.time_base = time_base
            return self.frame
        def terminate(self):
                if not (self.stream is None):
                    self.stream = None
            except AttributeError:
    rtc_video = RTCServer()
    url_youtube = 'rtmp://a.rtmp.youtube.com/live2/'
    url_youtube += 'SECRETE-KEY'
    recorder = MediaRecorder(url_youtube, format='flv')
    I have a couple of different datachannels that I would like to have active just for organization of data, however currently the only way I can find to separate the data is to add a prefix to the data sent

    I would like to be able to separate the datachannels using decorators like

    def ping_channel(message):
          #do something
    def temp_channel(message):
          #do something

    Currently I do this:

          def on_datachannel(channel):
                 def on_message(message):
                      print(f"Message is {message}")
                      if isinstance(message, str) and message.startswith("ping"):
                            #Do something
                      if isinstance(message, str) and message.startswith("Temp"):
                          #Do something
    alternative question, is there a complete list of the events somewhere>
    Hi, I'm trying to get to a single frame to process it. I can't seem to find anything related to single frame in webcam.py and server.py. Do I look there at all?
    Dan Steinman
    Hi, does anyone know of any audio reception and decoding examples using aiortc? I'm trying to do an audio-only UV4L rtc stream --> to a headless Raspberry Pi running aiortc, but having a lot of difficulty figuring how to receive the incoming audio.
        async def on_track(track):   ?? what to do here ???
    Cesar Almendarez
    Hello I am looking to implement the the "server" example of aiortc with the heroku hosting service. I have managed to clone the "server" example that is on the GitHub repo in the examples folder onto my local machine and run it on my local network successfully. I am just stumped on actually implementing this into the cloud. Thank you.
    I'm using the "server" example
    Initially, the parameter "transform == edges" ( VideoTransformTrack(
    relay.subscribe(track), transform=params["video_transform"]
    But when you click on the button in the browser, I want to change this parameter to "transform == cartoon"
    How can I do this without breaking the connection?
    Çağrı Sungur
    How can manupulate multiple frames before Using MediaRecorder('rtmp//server.com', format='flv')
    Does anyone have used AIORTC to connect two or more peer? I cannot make myself by seeing the example. If you can point me to correct direction. I will be gratefull
    i am trying to send frames from a server python instance to client instance. Here i am trying to construct frames locally and send them over MediaStreamTrack but when i receive the frames in my client instance its only loading few frames and looping over. Has anyone faced this issue ?
    is this channel active ?
    How can we use google's speech to text API with aiortc (audio being received over webrtc). Since I have tried using it but aiortc recv() function is never called when trying to use google's code with aiortc. Even somehow if I manage to use google's api , the audio coming from aiortc becomes extremely stuttered.
    Can somone tell me how to add a clockoverlay via the media option
    Pete Doherty
    Hey, all. I'm trying to port the client.js script in the aiortc examples to Python, so I'll be able to run two Python scripts in parallel and stream the video (from a file instead of the webcam) from one to the other. I seem to be missing something in my translation, though and the ICE connection is never fully established (gets hung at WAITING). I'm wondering if anyone has done anything similar and could offer some suggestions?