# \<Android\>Does this library requires 2 egl contexts for single video stream(RTCView)?

**URL:** <https://react-native-webrtc.discourse.group/t/android-does-this-library-requires-2-egl-contexts-for-single-video-stream-rtcview/1419>\
**Category:** Android\
**Created:** [November 18, 2021, 9:03am UTC](https://react-native-webrtc.discourse.group/t/android-does-this-library-requires-2-egl-contexts-for-single-video-stream-rtcview/1419 "2021-11-18T09:03:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![loganathan-s](https://yyz2.discourse-cdn.com/free1/user_avatar/react-native-webrtc.discourse.group/loganathan-s/32/494_2.png) [@loganathan-s](https://react-native-webrtc.discourse.group/u/loganathan-s)\
**Post date:** [November 18, 2021, 9:03am UTC](https://react-native-webrtc.discourse.group/t/android-does-this-library-requires-2-egl-contexts-for-single-video-stream-rtcview/1419/1 "2021-11-18T09:03:25Z")

</div>

In my android application, I couldn’t able to render more than 14 cameras on a single screen, beyond that my app crashed with an EGL context creation failed error. I believe this is a known defect in the [chromium webrtc](https://bugs.chromium.org/p/webrtc/issues/detail?id=12934&q=egl%20context&can=2) library when we have more than 30EGLcontext created.

just curious do we need 2 contexts for each webcam stream (RTCView) in the RN webrtc library, is there any workaround to increase the number of webcam stream support in a single screen?

---

<div class="post-metadata">

**Author:** ![poorvasingh04](https://yyz2.discourse-cdn.com/free1/user_avatar/react-native-webrtc.discourse.group/poorvasingh04/32/558_2.png) [@poorvasingh04](https://react-native-webrtc.discourse.group/u/poorvasingh04)\
**Post date:** [March 10, 2022, 1:06pm UTC](https://react-native-webrtc.discourse.group/t/android-does-this-library-requires-2-egl-contexts-for-single-video-stream-rtcview/1419/2 "2022-03-10T13:06:14Z")

</div>

Not sure if you still need help. But we had similar issue in react-native-webrtc library. We did 2 fixes for that.

1. Released streams once we switch off webcam
2. Fixed one issue in the library which is now merged as well. Here is the reference to PR. May be you can do similar fix in Android native library. [fix "Failed to create EGL context" exception by poorvasingh · Pull Request #1104 · react-native-webrtc/react-native-webrtc · GitHub](https://github.com/react-native-webrtc/react-native-webrtc/pull/1104)
