Giter Club home page Giter Club logo

Comments (3)

ZoroLH avatar ZoroLH commented on September 27, 2024

Same problem, and memory usage keep increasing when open multiple browser pages.

from aiortc.

ZoroLH avatar ZoroLH commented on September 27, 2024

Fixed by resize frame size from 19201080 to 640480. Looks like this is not MediaRelay's issue, but cpu's issue. Because is not running on GPU on my macbook for rtsp h.264 video. When I rendering multiple 1920*1080 video, my macbook is hot, cpu usage is closed to 100%. When I compress the video, all clients are rendering without loosing frame.
BTW, relay=MediaRelay(). should be global.

from aiortc.

rodolfoap avatar rodolfoap commented on September 27, 2024

BTW, relay=MediaRelay(). should be global.

Great! that was the solution. Resolution had no impact in my case.

player = MediaPlayer("rtsp://myserver:8554/live.sdp") # <- PLAYER IS UNIQUE
relay = MediaRelay()
async def offer(request):
    ...
    peer_connection = RTCPeerConnection()
    ...
    video = relay.subscribe(player.video)
    peer_connection.addTrack(video)
    ...

Just FYI, if you want to see the frame interleaving, create a video with numbered frames. In two browsers, you will clearly see one playing only odds and the other, evens.

But now, I have a second problem: the same MEMORY LEAK you've observed:

Same problem, and memory usage keep increasing when open multiple browser pages.

Will open a new issue for that, this precise problem is solved. Thanks!

from aiortc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.