Python Aiortc Video delay (after some seconds remote video is frozzen

63 Views Asked by At

I am trying to connect a browser peer with a server python peer.

The code I use to stream server video is:

    def create_local_tracks(self):
        global relay, webcam
    
        options = {"video_size": "640x480"}
        if relay is None:
            if platform.system() == "Darwin":
                webcam = MediaPlayer(
                    "default:none", format="avfoundation", options=options
                )
            elif platform.system() == "Windows":#this will be run
                webcam = MediaPlayer(
                    "video=HP True Vision HD Camera", format='dshow', options=options
                )
            else:
                webcam = MediaPlayer("/dev/video0", format="v4l2", options=options)
            relay = MediaRelay()
        return relay.subscribe(webcam.video)

The problem is that in client side the stream-video starts but the latency is big. Furthermore, after some seconds the remote video in client almost froze.

I am not sure this is related but i see this in console:

[swscaler @ 000001f35386bb40] deprecated pixel format used, make sure you did set range correctly

a lot of times.

How can I decrease the server video delay in client (browser)?

0

There are 0 best solutions below