-
Notifications
You must be signed in to change notification settings - Fork 22
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
Memory issues in broadcast upload extensions when using VP8 #16
Comments
Hi @yahmad, Thanks for writing in. Let me consult with @piyushtank before writing a full answer to your inquiry. In the meantime, we have discussed broadcast uploader extensions and some of the challenges in this issue: #7 Best, |
Thanks @ceaglest, look forward to hearing back.
I think we have got a working solution (or at least good enough within iOS limitations) for some of the problems mentioned in the other issue. I am hoping there might be some codec specific information / suggestions that might shed some light. 🤞 |
@yahmad, As you already figured, the memory grows beyond max limit. As mentioned as a known issue in our changelogs, 1280x720 resolution @ 30fps is not currently supported with H.264. By default, ReplayKit provides pixel buffers with native size of the screen. e.g 1080x1920 for iPhone 6s plus. If you downscale lower than 1280x720 @30fps video resolution, you should be able to broadcast H.264. Also, in my experience, if the video frame size is 640x480 the extension was using ~20MB of memory with VP8. In future, we are planning to provide APIs where you just need to provide provide the pixel buffers and the video sdk will downscale it for you. Also, we are planning to add a sample app which demonstrates the ReplayKit extension usage with Video SDK in next few days. I will let you know when it becomes available. Let me know if you have any questions. |
Hey @yahmad, Some feedback before I leave the office, to compliment what Piyush posted.
It depends on the type of Room you are in. In a Peer-to-Peer Room you encode a distinct stream for each Participant, but this is not the case in a Group Room.
It's not feasible to share a single encoder when different rates are being requested on different media connections. Ultimately, its a question of topology.
Piyush made some good suggestions above about downscaling. We are going to publish sample code which demonstrates the best practices using our current SDK. After 2.3.0-preview1 we will consider augmenting our capture APIs so you can request that the encoder perform downscaling. Also, there are other ways we can reduce memory usage in the encoder/capture pipeline. This was discussed in a little more detail in the linked issue (#7). Regards, |
Cheers @piyushtank , we are currently at least halving our resolution, but not sure about the specific resolution so I will find out if we can reduce it further.
@ceaglest Thanks, I figured this was how the encoders were probably working. Having a sample app will be really useful - thanks for providing this and for responding so quickly! |
We have an open which demonstrates ReplayKit broadcast service with TwilioVideo SDK - twilio/video-quickstart-ios#287 |
Thanks, we will take a look! |
Hello @yahmad (and other ReplayKit Developers), We have released 2.6.0-preview1, with new Video Source APIs that significantly improve the performance of streaming ReplayKit content. You can try our updated example now. Best, |
@ceaglest, some nice improvements there! I will try out the changes asap. Thanks, |
Hi @yahmad, In our 2.10.0 update, a ReplayKit extension can connect without subscribing to any Tracks. As long as a Group Room is used, the extension will now require less memory and CPU than before. Since we haven't heard from you in a while, I'll close out this issue. If you're still having memory usage problems with the latest update please reopen and let us know. Best, |
Description
We are encountering memory issues in broadcast extensions when trying to create P2P rooms with:
We are already downscaling the video quality to reduce memory usage, and also downscaling dynamically based on system memory warnings, but when a participant joins a multi-person P2P room requiring a VP8 codec for video, the broadcast extension crashes fairly quickly due to exceeding memory limits.
We were hoping this was an edge case, but did some testing and found there are quite a few devices which don't have hardware support for H.264 (a few we personally tested are listed below).
Questions
Memory stats
It looks like each H.264 compatible participant added to the room increases memory usage by about 2.5MB (an encoder per participant?), but when a participant without this capability joins, it falls back to using VP8 which requires upto 15MB of memory to encode.
Android problem devices
Encountered devices which do not have H.264 hardware support (mid-level devices from manufacturers based in China/East-Asia seem to especially not provide H.264 hardware support):
Versions
Video iOS SDK
TwilioVideo v2.1 via CocoaPods
Xcode
Xcode v9.4.1
iOS Version
iOS 11.4
iOS Device
iPhone 7
iPhone X
The text was updated successfully, but these errors were encountered: