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

Sharing failure due to memory exceeding 50m #25

Open
huoda1237 opened this issue Dec 6, 2021 · 5 comments
Open

Sharing failure due to memory exceeding 50m #25

huoda1237 opened this issue Dec 6, 2021 · 5 comments

Comments

@huoda1237
Copy link

huoda1237 commented Dec 6, 2021

Send audio and video at the same time. After a period of time, the memory will exceed 50m, and then sharing will stop. If I only send video but not audio, there will be no problem. How can I solve this problem?

@akihikodaki
Copy link
Contributor

So you use it with a broadcast extension? It can easily go beyond 50MB even you only send video, depending on the content. Basically you need to implement precise controls of memory usage by restricting video bitrate. (Audio costs some memory but not that much. It ate the last chunk of memory in your case, but it is likely that the video costed the most of memory, leaving a tiny room for audio.) I don't remember the details of the bitrate control so maybe you may ask on WebRTC forum or somewhere. IIRC, it requires to modify SDP, which is quite a hacky.

@huoda1237
Copy link
Author

ok,thank you

@DevMile
Copy link

DevMile commented Jan 14, 2022

@huoda1237 Hi, I solved this issue with this line of code:
videoSource!.adaptOutputFormat(toWidth: 600, height: 800, fps: 15)
You can try to modify values per your need.

@yiran1234gcz
Copy link

同时发送音频和视频。一段时间后,内存会超过50m,然后就停止共享了。如果我只发视频不发音频,就没有问题。我怎么解决这个问题?

请问你是怎么在子进程推送音频的呢?

@huoda1237
Copy link
Author

huoda1237 commented May 8, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants