Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
    looks very quite here :> is there a other channel like discord or irc slack ?
    Zack Schwartz
    I'm using the server example of aiortc which I got working, but I'd like to stream what I receive at the server side to an RTMP endpoint. Does anyone have any guidance on that?
    Hello all, I have raised an issue,
    This is for pyav but hampers the installation for aiortc, did anyone encounter this while installing aiortc?
    Hi all. I am having trouble install aiortc on Mac. I keep getting this:ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
    If anyone has any insight - would love it!
    Michael Noronha
    Hi, I've got a bit of a basic question -- I have a client receiving a sequence of frames (via a VideoStreamTrack) from a server, and I want to process that sequence of frames on the client. I understand how to process them on the server (in recv, right?), but how can I do it on the client?
    Michael Noronha
    The solution I came up with is pretty simple: in my @pc.on("datachannel") and @pc.on("track") handlers, I check if the other one has been initialized. They happen sequentially, so one of them must have both initialized and from there I set up a function that processes them in a loop
    I'd be interested to hear about better ways of doing this though
    I run some transformation a aiortc video stream and change the transformation at runtime. The switch to another transformations takes some secs and I end up with an accumulated delay on the stream. Is there a way to skip the queued frames and jump to the latests frame to reduce this delay?

    Hi, I'm trying to process with OpenCV and python a live video transmission from a WebRTC site: https://webrtc-streamer.herokuapp.com/webrtcstreamer.html?video=Bahia&options=rtptransport%3Dtcp%26timeout%3D60& But I can't open the video with cv2.videocapture (URL).

    How could I open the video that is compatible with OpenCV? I appreciate it if you demonstrate the code.

    Ilyas Salhi
    hey everyone, I'm new here and just curious if anyone has done clientjs to serverpy example with multiple datachannels for one peer connection? I modified the example/server in the project's repo to conditionally respons based on the channel label, but I noticed that RTT goes up. Curious if I'm just using asyncio wrong or if anyone has found ways of opening extra channels without hurting latency
    Ilyas Salhi
    Interesting thing is that the second channel has the larger RTT's
    Wondering if there's a way to thread each datachannel seperately
    Ilyas Salhi
    Also its the act of creating two channels that slows things down, increasing the rate of transmission to 2X the original has better RTT's, super interesting

    Hi everyone. I know this might not be the correct channel for this, but just in case. Has anyone had experience with accepting multiple webrtc sources, encoding to a single tiled video output and then republishing via RTMP to twitch/youtube/... ?

    If i understand the workflow correctly I would first establish a webrtc connection between server and client applications, use ffmpeg (?) to encode to video and then output to rtmp endpoint. In theory seems simple, just checking if anyone has additional knowledge and is willing to share. Especially with ffmpeg I'm not entierly clear how would I arrange tiles or allow server to receive instructions on how to actually tile the video if new participants are added etc...

    or is this something that could be accomplished with MediaRecorded class ?
    Hi everyone 👋. Can some one please point me to python example of establishing the webrtc connection?
    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.