Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Live Stream/End Stream with WebRTC took almost 100% machine resources on Safari browser on MacOS of Apple chip #5656

Closed
trunghm opened this issue Oct 6, 2023 · 5 comments · May be fixed by ant-media/StreamApp#411
Assignees
Labels

Comments

@trunghm
Copy link

trunghm commented Oct 6, 2023

Short description

Live Stream/End Stream with WebRTC took almost 100% machine resources and hung the browser for 5-15 seconds on Safari browser on MacOS of Apple chip.

Environment

  • Operating system and version: Mac OS Sonoma M1/M2 16G RAM. I could also reproduce the issue on Mac OS Ventura
  • Ant Media Server version: Enterprise Edition 2.5.0 20221012_1646
  • Browser name and version: Safari Version 17.0 (19616.1.27.211.1)

Steps to reproduce

  1. Open the Ant media live demo server (https://antmedia.io/live-demo/) or our development server (https://tstantmds.redhotpie.com.au:5443/LiveApp/index.html)
  2. Observe the browser's responsiveness between the time the page loads and the video from the camera appears.

Expected behavior

The video appears after 1-2 seconds, same as what the standard webRTC takes - see example at https://webrtc.github.io/samples/src/content/getusermedia/gum/

Actual behavior

The browser hung from when I clicked on the Allow button to allow the camera until the cam appeared. The app appeared to take almost 100% CPU and network resources for about 5-15 seconds. The hung time period is to 15 seconds on Apple M1 Mac Pro, down to 5 seconds on Apple M2 Mac Pro. This issue is only observed on the Safari browser on Mac OS with an Apple chip. It's not happening on other browsers on the same machine, nor the Safari browser of Intel Mac

Ask your questions on Ant Media Github Discussions

@mekya mekya added the support label Oct 9, 2023
@mekya mekya moved this to Next Sprint in Ant Media Server Oct 9, 2023
@mekya
Copy link
Contributor

mekya commented Oct 9, 2023

Hi @trunghm,

Thank you very much for creating the issue. We plan to handle this issue as a support perspective. I'm putting this to the backlog.

Regards
Oguz

@mekya mekya moved this from Next Sprint to 🔖 Sprint in Ant Media Server Oct 9, 2023
@timantmedia
Copy link
Contributor

@trunghm I tested Safari 16.6 on a Mac M1 using the latest version of Ant Media Server and didn't experience any issues. I also tried https://antmedia.io/live-demo with no issues.

Can you try using https://antmedia.io/live-demo and tell me if you still experience any problems with Safari and Mac?

@nexlesoft
Copy link

Hello @timantmedia ,

Thank you for looking into the issue.

I've checked the site https://antmedia.io/live-demo, and noticed the issue has been improved compared to what I saw earlier, but it's still there.

There are two things that I think may be helpful for you to check

  • check if you do anything on your demo website (e.g., selecting texts) after you click on the Allow button on the camera permission popup until the app gets the video and shows it on the screen. The Safari browser is freezing, and the entire machine is freezing until the app shows the video from the camera.
  • compare the taken time between your demo site and standard WebRTC (e.g. https://webrtc.github.io/samples/src/content/getusermedia/gum/), you would see the taken time to get the camera on the standard WebRTC is much shorter.

Please let me know if you need further info.

@e-vural
Copy link

e-vural commented Oct 20, 2023

@e-vural
Same problem. I add comparison.

Device: Macbook Pro 16 , Apple M1 Max, 32 GB Ram, 1 TB

Safari:

Ekran.Kaydi.2023-10-20.16.12.41.mov

Chrome:

Ekran.Kaydi.2023-10-20.16.14.43.mov

@mekya mekya moved this from 🔖 Sprint to Next Sprint in Ant Media Server Oct 23, 2023
@mekya mekya moved this from Next Sprint to 🔖 Sprint in Ant Media Server Oct 23, 2023
@mustafaboleken mustafaboleken moved this from 🔖 Sprint to 🏗 In progress in Ant Media Server Oct 29, 2023
@mekya mekya moved this from 🏗 In progress to After sprint in Ant Media Server Nov 13, 2023
@mekya mekya self-assigned this Dec 4, 2023
@burak-58
Copy link
Contributor

We couldn't reproduce the problem and merge the implementation. So I am closing the issue now. Anyone can re-open the issue if encounter the same problem.

@github-project-automation github-project-automation bot moved this from After sprint to ✅ Done in Ant Media Server Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

8 participants